Browse Source

购物车总数

lizhen_gitee 3 tháng trước cách đây
mục cha
commit
b65000d14f
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  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 = [];