v.2.24
1. Редактор карты зала.
This commit is contained in:
@@ -6,30 +6,33 @@ use App\Component\Models\Settings;
|
||||
use App\Console\Commands\HRCCommand;
|
||||
use App\Console\Commands\HRCCommandInterface;
|
||||
|
||||
class GETSettings extends HRCCommand implements HRCCommandInterface {
|
||||
protected $signature = 'getsettings';
|
||||
class GETSettings extends HRCCommand implements HRCCommandInterface
|
||||
{
|
||||
protected $signature = 'getsettings';
|
||||
|
||||
public function command($input, $output = null) {
|
||||
if (isset($input['code'])) {
|
||||
$setting = Settings::where('code', $input['code'])->first();
|
||||
if ($setting) {
|
||||
return [
|
||||
'status' => 'success',
|
||||
'code' => $setting['code'],
|
||||
'value' => $setting['value'],
|
||||
];
|
||||
} else {
|
||||
return [
|
||||
'status' => 'error',
|
||||
'more' => 'Setting not found',
|
||||
];
|
||||
}
|
||||
} else {
|
||||
$settings = Settings::all();
|
||||
return [
|
||||
'status' => 'success',
|
||||
'settings' => $settings,
|
||||
];
|
||||
}
|
||||
}
|
||||
public function command($input, $output = null)
|
||||
{
|
||||
if (isset($input['code'])) {
|
||||
$setting = Settings::where('code', $input['code'])
|
||||
->first();
|
||||
if ($setting) {
|
||||
return [
|
||||
'status' => 'success',
|
||||
'code' => $setting['code'],
|
||||
'value' => $setting['value'],
|
||||
];
|
||||
} else {
|
||||
return [
|
||||
'status' => 'error',
|
||||
'more' => 'Setting not found',
|
||||
];
|
||||
}
|
||||
} else {
|
||||
$settings = Settings::all();
|
||||
return [
|
||||
'status' => 'success',
|
||||
'settings' => $settings,
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user