v.2.24
1. POSTBonus in/out 2. POSTPresale in/out 3. Переработана форма гостя
This commit is contained in:
45
commands/GETBot.php
Normal file
45
commands/GETBot.php
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
namespace App\Commands;
|
||||
|
||||
use App\Component\Models\Dishes;
|
||||
use App\Component\Models\Folders;
|
||||
use App\Component\Models\OrderBot;
|
||||
use App\Component\Models\Settings;
|
||||
use App\Component\Models\Tasks;
|
||||
use App\Console\Commands\HRCCommand;
|
||||
use App\Console\Commands\HRCCommandInterface;
|
||||
|
||||
class GETBot 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::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