<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\Shop\Command; use Carbon\Carbon; use ModStart\Core\Dao\ModelUtil; use Module\Shop\Jobs\OrderExpireCheckJob; use Illuminate\Console\Command; use Illuminate\Foundation\Bus\DispatchesJobs; use Module\Vendor\Type\OrderStatus; class ShopOrderExpireCheck extends Command { use DispatchesJobs; protected $signature = 'ShopOrderExpireCheck'; protected $description = 'ShopOrderExpireCheck'; public function handle() { $Xv_nR = ModelUtil::model('order')->where(array('status' => OrderStatus::WAIT_PAY))->where('created_at', '<', Carbon::now()->subMinutes(30))->limit(10)->get()->toArray(); foreach ($Xv_nR as $k59zY) { OrderExpireCheckJob::create($k59zY['id']); } } }