Explorar o código

购物车总数

lizhen_gitee hai 3 meses
pai
achega
b65000d14f
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  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 = [];