Fixed reports
This commit is contained in:
miroman-afk
2023-05-02 15:21:54 +03:00
parent 70120653f7
commit fb46c8e739
78 changed files with 21233 additions and 1892 deletions

View File

@@ -12,4 +12,19 @@ class Printer extends Model {
* @var array
*/
protected $guarded = [];
public static function getName($data) {
$printer_name = Printer::where('code', $data)->where('is_history', 0)->first();
if ($printer_name) {
$printer_name = $printer_name['name'];
} else {
$printer_name = Printer::where('code', $data)->where('is_history', 1)->first();
if ($printer_name) {
$printer_name = $printer_name['name'];
} else {
$printer_name = 'Связанный принтер удален';
}
}
return $printer_name;
}
}