<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\PayCenter\Command; use Carbon\Carbon; use Illuminate\Console\Command; use Illuminate\Support\Facades\Event; use ModStart\Core\Dao\ModelUtil; use ModStart\Core\Util\EventUtil; use Module\PayCenter\Events\OrderExpiredEvent; use Module\PayCenter\Type\PayOrderStatus; class PayOrderExpireCheckCommand extends Command { protected $signature = 'PayCenter:PayOrderExpireCheck'; public function handle() { $sX2oK = ModelUtil::model('pay_order')->where(array('status' => PayOrderStatus::NEW_ORDER))->where('created_at', '<', date('Y-m-d H:i:s', time() - 1800))->get()->toArray(); foreach ($sX2oK as $HsIf6) { goto Eb1Xw; iRy3I: EventUtil::fire($u17bI); goto mFTkV; Eb1Xw: ModelUtil::update('pay_order', $HsIf6['id'], array('status' => PayOrderStatus::CLOSED_EXPIRED, 'timeClosed' => Carbon::now())); goto w6xwY; yIb8j: $u17bI->biz = $HsIf6['biz']; goto pnRLE; w6xwY: $u17bI = new OrderExpiredEvent(); goto yIb8j; pnRLE: $u17bI->bizId = $HsIf6['bizId']; goto gJ97R; gJ97R: $u17bI->order = $HsIf6; goto iRy3I; mFTkV: } } }