瀏覽代碼

修改获取购物车中的广告位

15313670163 2 月之前
父節點
當前提交
decf6318c9
共有 1 個文件被更改,包括 5 次插入2 次删除
  1. 5 2
      app/JsonRpc/OrderService.php

+ 5 - 2
app/JsonRpc/OrderService.php

@@ -790,11 +790,14 @@ class OrderService implements OrderServiceInterface
      */
     public function getShoppingCartAD(array $data): array
     {
-        $result = ShoppingCart::where('shopping_id', $data['shopping_id'])
+        $shopcart = ShoppingCart::where('shopping_id', $data['shopping_id'])
         ->where('user_id',$data['user_id'])
         ->orderBy('pid')
-        ->get()
+        ->pluck('pid')
         ->toArray();
+    
+        $result['pid'] = $shopcart;
+    
         if (empty($result)) {
             return Result::error("购物车id错误");
         }else{