51 lines
1021 B
PHP
51 lines
1021 B
PHP
<?php
|
|
|
|
namespace App\Console\Commands;
|
|
|
|
use Illuminate\Console\Command;
|
|
use Carbon\Carbon;
|
|
use App\Models\Order;
|
|
|
|
class FinishWaitShippingOrder extends Command
|
|
{
|
|
/**
|
|
* The name and signature of the console command.
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $signature = 'milk-tea:finish_wait_shipping_order';
|
|
|
|
/**
|
|
* The console command description.
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $description = '自动完成有取餐码待取货的订单';
|
|
|
|
/**
|
|
* Create a new command instance.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function __construct()
|
|
{
|
|
parent::__construct();
|
|
}
|
|
|
|
/**
|
|
* Execute the console command.
|
|
*
|
|
* @return int
|
|
*/
|
|
public function handle()
|
|
{
|
|
|
|
$list = Order::where([
|
|
'order_status'=>1,
|
|
'pay_status'=>1,
|
|
])->whereNotNull('order_number')->where('number_time', '<', now())->update(['shipping_status'=>1]);
|
|
|
|
$this->info('执行成功');
|
|
}
|
|
}
|