Добавлен расширенный отчет по реализации
Добавлен монитор активности
This commit is contained in:
miroman-afk
2023-08-03 11:05:15 +03:00
parent 19ad7d1c8a
commit c4dc6e02a0
93 changed files with 13328 additions and 1122 deletions

View File

@@ -0,0 +1,43 @@
<?php
namespace App\Commands;
use App\Component\Models\Terminal;
use App\Console\Commands\HRCCommand;
use App\Console\Commands\HRCCommandInterface;
class POSTTerminals extends HRCCommand implements HRCCommandInterface
{
protected $signature = 'postterminals';
public function command($input, $output = null)
{
if (isset($input['method'])) {
$method = $input['method'];
if ($method == 'update') {
if (isset($input['data'])) {
$data = $input['data'];
$data = json_decode(base64_decode(urldecode($data)), true);
$terminals = Terminal::get();
foreach ($terminals as $terminal) {
if ($terminal['work_group'] == $data['work_group']) {
$item = Terminal::find($terminal['id']);
$item->name = $data['name'];
$item->save();
}
}
$terminals = Terminal::get();
return [
'status' => 'success',
'terminals' => $terminals
];
}
}
}
return [
'status' => 'fail',
'error_message' => 'Проверьте введенные данные',
];
}
}