zhangguidong 2 years ago
parent
commit
bc2faa189d
1 changed files with 4 additions and 0 deletions
  1. 4 0
      application/api/model/order/OrderOper.php

+ 4 - 0
application/api/model/order/OrderOper.php

@@ -541,6 +541,10 @@ trait OrderOper
             foreach ($data as $key => $od) {
                 $data[$key] = self::setOrderItemStatusByOrder($od);
                 $data[$key]['expired_time'] = $od['createtime'] + (15 * 60);
+                $time = $time-$od['createtime'] + (15 * 60);
+                if($time>0&&$od['status']==0){
+                    Db::name('shopro_order')->where('id' ,$od['id'])->update(['status'=>-1]);
+                }
             }
 
             $orders['data'] = $data;