<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\Shop\Provider; use ModStart\Core\Dao\ModelUtil; use Module\Vendor\Provider\Schedule\AbstractScheduleBiz; use Module\Vendor\Type\OrderStatus; class OrderExpireScheduleProvider extends AbstractScheduleBiz { public function cron() { return $this->cronEveryMinute(); } public function title() { return '商城未支付订单过期'; } public function run() { $MCyeh = ModelUtil::model('order')->where(array('status' => OrderStatus::WAIT_PAY))->where('created_at', '<', date('Y-m-d H:i:s', time() - 1800))->get()->toArray(); foreach ($MCyeh as $v9Xk2) { ModelUtil::update('order', $v9Xk2['id'], array('status' => OrderStatus::CANCEL_EXPIRED)); } } }