quguofeng 2 年之前
父节点
当前提交
a00a6dccd4
共有 2 个文件被更改,包括 16 次插入1 次删除
  1. 15 0
      app/common/dao/store/order/StoreOrderDao.php
  2. 1 1
      app/controller/api/Auth.php

+ 15 - 0
app/common/dao/store/order/StoreOrderDao.php

@@ -743,4 +743,19 @@ class StoreOrderDao extends BaseDao
         })->where('StoreOrder.uid',$uid)->count()
        ;
     }
+    /**
+     * TODO 获取超时订单数据
+     * @param $id
+     * @param $uid
+     * @return array|Model|null
+     * @throws DataNotFoundException
+     * @throws DbException
+     * @throws ModelNotFoundException
+     * @author xaboy
+     * @day 2020/6/11
+     */
+    public function expireOrder()
+    {
+        return StoreOrder::getDB()->where('expire_time','>', date('Y-m-d H:i:s'))->find();
+    }
 }

+ 1 - 1
app/controller/api/Auth.php

@@ -428,7 +428,7 @@ class Auth extends BaseController
             }
         }
         $storeOrderRepository = app()->make(StoreOrderRepository::class);
-        $info = $storeOrderRepository->where('expire_time','<=',date('Y-m-d H:i:s'))->get();
+        $info = $storeOrderRepository->expireOrder();
         var_dump($info);exit();
         $user = $repository->registr($data['phone'], $data['pwd'], $data['user_type'],$pid,$order_id);
         if($user->order_id){