35 lines
1.2 KiB
PHP
35 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace App\Commands;
|
|
|
|
use App\Component\Models\Printer;
|
|
use App\Component\Models\PrinterSettings;
|
|
use App\Component\Models\Terminal;
|
|
use App\Console\Commands\HRCCommand;
|
|
use App\Console\Commands\HRCCommandInterface;
|
|
|
|
class Equipment extends HRCCommand implements HRCCommandInterface {
|
|
protected $signature = 'getequipment';
|
|
|
|
public function command($input, $output = null) {
|
|
$terminals = Terminal::select('work_code', 'work_group')
|
|
->where('key', '=', $input['terminal'])
|
|
->get();
|
|
foreach ($terminals as $terminal) {
|
|
$terminal_data = array('work_code' => $terminal['work_code'], 'work_group' => $terminal['work_group']);
|
|
}
|
|
$printer_groups = Printer::select('code', 'name')
|
|
->where('is_history', '=', 0)
|
|
->get();
|
|
$printers = PrinterSettings::select('name', 'id', 'ip', 'com_port', 'type', 'speed', 'printer_group', 'template', 'size', 'driver', 'codepage', 'more')
|
|
->where('workgroup', '=', $terminal_data['work_group'])
|
|
->where('workcode', '=', $terminal_data['work_code'])
|
|
->get();
|
|
return [
|
|
'status' => 'success',
|
|
'terminal_data' => $terminal_data,
|
|
'printer_groups' => $printer_groups,
|
|
'printers' => $printers,
|
|
];
|
|
}
|
|
} |