Browse Source

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

15313670163 2 tháng trước cách đây
mục cha
commit
decf6318c9
1 tập tin đã thay đổi với 5 bổ sung2 xóa
  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{