|
@@ -16,10 +16,11 @@ class OrderExpiredCommand extends Command{
|
|
|
|
|
|
protected function execute(Input $input, Output $output)
|
|
|
{
|
|
|
- $orders= MobileOrder::expired()->select();
|
|
|
+ $orders= MobileOrder::expired()->field('id')->select();
|
|
|
foreach ($orders as $order){
|
|
|
try {
|
|
|
Db::startTrans();
|
|
|
+ $order=MobileOrder::where('id',$order['id'])->lock(true)->find();
|
|
|
$order->cancel();
|
|
|
Db::commit();
|
|
|
}catch (\Exception $e){
|