v.2.2 Update
Top dishes block update
This commit is contained in:
28
commands/GETClientGroup.php
Normal file
28
commands/GETClientGroup.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace App\Commands;
|
||||
|
||||
use App\Component\Models\ClientsGroup;
|
||||
use App\Console\Commands\HRCCommand;
|
||||
use App\Console\Commands\HRCCommandInterface;
|
||||
|
||||
class GETClientGroup extends HRCCommand implements HRCCommandInterface {
|
||||
protected $signature = 'getclientgroup';
|
||||
|
||||
public function command($input, $output = null) {
|
||||
if (ClientsGroup::where('code', '0')->count() == 0) {
|
||||
$group = new ClientsGroup;
|
||||
$group->code = '0';
|
||||
$group->name = 'Без группы';
|
||||
$group->save();
|
||||
}
|
||||
$client_groups = ClientsGroup::orderBy('code')->get();
|
||||
foreach ($client_groups as $client_group) {
|
||||
$out[] = array('id' => $client_group['id'], 'name' => $client_group['name']);
|
||||
}
|
||||
return [
|
||||
'status' => 'success',
|
||||
'groups' => $out,
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user