WIN-2308041133\Administrator 2 weeks ago
parent
commit
f4bc235a24
1 changed files with 14 additions and 5 deletions
  1. 14 5
      app/dao/order/StoreOrderCartInfoDao.php

+ 14 - 5
app/dao/order/StoreOrderCartInfoDao.php

@@ -85,10 +85,19 @@ class StoreOrderCartInfoDao extends BaseDao
             ->count();
         return $count > 0;
     }
-    public function getUserProduct($uid,$product,$order_ids){
-        $res = $this->getModel()->where('uid',$uid)->where('product_id',$product)->where('oid','in',$order_ids)->count();
-        $sql = $this->getModel()->getLastSql();
-        @file_put_contents("quanju.txt", $sql."sql语句\r\n", 8);
-        return $res;
+
+    public function getUserProduct($uid, $product, $order_ids)
+    {
+        try {
+        
+
+            $res = $this->getModel()->where('uid', $uid)->where('product_id', $product)->where('oid', 'in', $order_ids)->count();
+            $sql = $this->getModel()->getLastSql();
+            @file_put_contents("quanju.txt", $sql . "sql语句\r\n", 8);
+            return $res;
+        } catch (\Exception $e) {
+            @file_put_contents("quanju.txt", json_encode($e->getMessage()) . "-报错内容\r\n", 8);
+            throw $e;
+        }
     }
 }