Przeglądaj źródła

蒙牛-app购物车 的购物车列表和购物车里待支付数量对应不上的bug

三七 4 tygodni temu
rodzic
commit
03eb3e95ed

+ 6 - 1
fs-service/src/main/java/com/fs/hisStore/mapper/FsStoreCartScrmMapper.java

@@ -106,8 +106,13 @@ public interface FsStoreCartScrmMapper
     void updateIsPay(String cartIds);
 
 
-    @Select("select ifnull(sum(c.cart_num),0) from fs_store_cart_scrm c inner join fs_store_product_scrm p on p.product_id=c.product_id inner join fs_store_product_attr_value_scrm v on v.id=c.product_attr_value_id where c.is_pay=0 and c.is_del=0 and c.is_buy=0 and p.is_show=1 and p.is_del=0 and c.user_id= #{userId}")
+    @Select("select ifnull(sum(c.cart_num),0) from fs_store_cart_scrm c " +
+            "inner join fs_store_product_scrm p on p.product_id=c.product_id " +
+            "inner join fs_store_product_attr_value_scrm v " +
+            "on v.id=c.product_attr_value_id " +
+            "where c.is_pay=0 and c.is_del=0 and c.is_buy=0 and p.is_show=1 and p.is_del=0 and c.user_id= #{userId}")
     Integer selectFsStoreCartCountByUserId(long userId);
+
     @Select({"<script> " +
             "select ifnull(sum(c.cart_num),0) from fs_store_cart_scrm c  " +
             "where c.is_pay=0 and c.is_del=0 and c.is_buy=0 " +

+ 2 - 1
fs-user-app/src/main/java/com/fs/app/controller/store/ProductScrmController.java

@@ -336,7 +336,8 @@ public class ProductScrmController extends AppBaseController {
     @GetMapping("/getCartCount")
     public R getCartCount(FsStoreCartCountParam param){
         param.setUserId(Long.parseLong(getUserId()));
-        Integer count=cartService.selectFsStoreCartCount(param);
+//        Integer count=cartService.selectFsStoreCartCount(param);
+        Integer count=cartService.selectFsStoreCartCountByUserId(Long.parseLong(getUserId()));
         return R.ok().put("data", count);
     }