소스 검색

购物车总数

lizhen_gitee 3 달 전
부모
커밋
b65000d14f
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      addons/unishop/controller/Product.php

+ 1 - 1
addons/unishop/controller/Product.php

@@ -99,7 +99,7 @@ class Product extends Base
             }
 
             // 购物车数量
-            $data->cart_num = (new \addons\unishop\model\Cart)->where(['user_id' => $this->auth->id])->count();
+            $data->cart_num = (new \addons\unishop\model\Cart)->where(['user_id' => $this->auth->id])->sum('number');
 
             // 评价信息
             $data->evaluate_list = [];