<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\Express\Core; use Module\Express\Model\ExpressItem; use Module\Express\Type\ExpressItemStatus; use Module\Express\Util\ExpressItemUtil; use Module\Vendor\Provider\Schedule\AbstractScheduleBiz; class ExpressItemUpdateScheduleBiz extends AbstractScheduleBiz { public function name() { return 'ExpressItemUpdate'; } public function cron() { return $this->cronEveryMinute(); } public function title() { return '更新快递物品信息'; } public function run() { $MCyeh = ExpressItem::query()->whereNull('status')->orWhere(function ($jyBel) { $jyBel->where(array('status' => ExpressItemStatus::SHIPPING))->where('statusUpdateTime', '<', date('Y-m-d H:i:s', time() - 3600)); })->limit(1)->get()->toArray(); foreach ($MCyeh as $lLaeU) { ExpressItemUtil::updateStatusIfNeed($lLaeU); } } }