1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- <?php
- namespace App\Console\Commands\SendOrder;
- use App\Modules\SendOrder\Services\SendOrderChargeStatService;
- use Illuminate\Console\Command;
- class StatSendOrderByDate extends Command
- {
-
- protected $signature = 'send_order_recharge_stat {--start_date=} {--end_date=}';
-
- protected $description = '派单充值数据统计';
-
- public function handle(): bool
- {
- $date = date('Y-m-d', strtotime('-1 days'));
- $start_date = $this->option('start_date');
- $end_date = $this->option('end_date');
-
- if ($start_date && $end_date && $start_date <= $end_date) {
- while (strtotime($start_date) <= strtotime($end_date)) {
- var_dump($start_date);
-
- SendOrderChargeStatService::deleteSendOrderStatsByDate($start_date);
-
- SendOrderChargeStatService::getOrdersByDate($start_date);
-
- $start_date = date('Y-m-d', strtotime('+1 days', strtotime($start_date)));
- }
- } else {
-
- SendOrderChargeStatService::deleteSendOrderStatsByDate($date);
-
- SendOrderChargeStatService::getOrdersByDate($date);
- }
- return true;
- }
- }
|