Browse Source

fix:gouwuhce

super-yimizi 1 month ago
parent
commit
14fe2b943f

+ 1 - 1
application/api/controller/Cart.php

@@ -171,7 +171,7 @@ class Cart extends Base
         CartService::updateChecked(
             $userId,
             $cartIds,
-            $isChecked == 1);
+            $isChecked);
         $this->success('操作成功');
     }
 }

+ 1 - 1
application/common/Service/CartService.php

@@ -136,7 +136,7 @@ class CartService
         }
     }
 
-    public static function updateChecked($userId, $cartIds=[], $isChecked)
+    public static function updateChecked($userId, $cartIds=[], $isChecked=0)
     {
         return Carts::where('user_id', $userId)
             ->whereIn('id', $cartIds)

+ 1 - 1
application/common/service/CartService.php

@@ -136,7 +136,7 @@ class CartService
         }
     }
 
-    public static function updateChecked($userId, $cartIds=[], $isChecked)
+    public static function updateChecked($userId, $cartIds=[], $isChecked=0)
     {
         return Carts::where('user_id', $userId)
             ->whereIn('id', $cartIds)