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

@@ -3,6 +3,8 @@
namespace App\Commands;
use App\Component\Models\Settings;
use App\Component\Commands\Methods\Cache;
use App\Component\Models\Terminal;
use App\Console\Commands\HRCCommand;
use App\Console\Commands\HRCCommandInterface;
@@ -12,6 +14,34 @@ class GETSettings extends HRCCommand implements HRCCommandInterface
public function command($input, $output = null)
{
if (isset($input['method'])) {
$method = $input['method'];
if ($method == 'terminals') {
$out = [];
$terminals = Terminal::get();
foreach ($terminals as $terminal) {
if ($terminal['is_active'] === 1) {
$is_active = true;
} else {
$is_active = false;
}
$out[] = array(
'work_code' => $terminal['work_code'],
'work_group' => $terminal['work_group'],
'soft' => $terminal['soft'],
'is_active' => $is_active,
'key' => $terminal['key'],
'last_activity' => $terminal['last_activity'],
);
}
return [
'status' => 'success',
'terminals' => $out,
];
}
}
if (isset($input['code'])) {
$setting = Settings::where('code', $input['code'])
->first();