v.2.24
1. Редактор карты зала.
This commit is contained in:
@@ -10,25 +10,36 @@ use App\Component\Models\Tasks;
|
||||
use App\Console\Commands\HRCCommand;
|
||||
use App\Console\Commands\HRCCommandInterface;
|
||||
|
||||
class Bot extends HRCCommand implements HRCCommandInterface {
|
||||
protected $signature = 'getbot';
|
||||
class Bot extends HRCCommand implements HRCCommandInterface
|
||||
{
|
||||
protected $signature = 'getbot';
|
||||
|
||||
public function command($input, $output = null) {
|
||||
$settings = Settings::where('code', '=', 5)->where('value', '=', 1)->get();
|
||||
if (isset($settings['0']['value'])) {
|
||||
$dishes = Dishes::where('is_bot_export', '=', 0)->update(['is_bot_export' => 1]);
|
||||
$folders = Folders::where('is_bot_export', '=', 0)->update(['is_bot_export' => 1]);
|
||||
}
|
||||
$ordersinfo = Tasks::where('method', '=', 'orderinfo')->get();
|
||||
$delete_params = ['closed', 'deleted'];
|
||||
foreach ($ordersinfo as $more) {
|
||||
$order = OrderBot::where('id', '=', $more['more'])->whereIn('status', $delete_params)->get();
|
||||
foreach ($order as $value) {
|
||||
$delete = Tasks::where('method', '=', 'orderinfo')->where('more', '=', $value['id'])->delete();
|
||||
}
|
||||
}
|
||||
return [
|
||||
'status' => 'success',
|
||||
];
|
||||
}
|
||||
public function command($input, $output = null)
|
||||
{
|
||||
$settings = Settings::where('code', 5)
|
||||
->where('value', 1)
|
||||
->get();
|
||||
if (isset($settings['0']['value'])) {
|
||||
Dishes::where('is_bot_export', '=', 0)
|
||||
->update(['is_bot_export' => 1]);
|
||||
Folders::where('is_bot_export', '=', 0)
|
||||
->update(['is_bot_export' => 1]);
|
||||
}
|
||||
$ordersinfo = Tasks::where('method', 'orderinfo')
|
||||
->get();
|
||||
$delete_params = ['closed', 'deleted'];
|
||||
foreach ($ordersinfo as $more) {
|
||||
$order = OrderBot::where('id', intval($more['more']))
|
||||
->whereIn('status', $delete_params)
|
||||
->get();
|
||||
foreach ($order as $value) {
|
||||
Tasks::where('method', 'orderinfo')
|
||||
->where('more', $value['id'])
|
||||
->delete();
|
||||
}
|
||||
}
|
||||
return [
|
||||
'status' => 'success',
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user