diff --git a/app/goods/controller/GoodsController.php b/app/goods/controller/GoodsController.php index da79e53..8415d54 100644 --- a/app/goods/controller/GoodsController.php +++ b/app/goods/controller/GoodsController.php @@ -80,7 +80,11 @@ class GoodsController extends HomeBaseController $data['integral'] = '该商品无积分奖励'; } $data['content'] = html_entity_decode($data['content']); - $total = Db::name('zj_cart')->field('sum(num) as total')->where(['uid' => session('user.id')])->select(); + $total = Db::name('zj_cart')->alias('c') + ->field('sum(num) as total') + ->join('zj_goods g', 'c.gid=g.id') + ->where(['uid' => session('user.id'), 'is_sta' => 2]) + ->select(); if ($total[0]['total'] == '') { $total = 0; } else {