diff --git a/app/controller/api/dataview/Merchant.php b/app/controller/api/dataview/Merchant.php index 6fb40ac9..4ef0e5e9 100644 --- a/app/controller/api/dataview/Merchant.php +++ b/app/controller/api/dataview/Merchant.php @@ -138,7 +138,7 @@ class Merchant extends BaseController ->field(\think\facade\Db::raw('sum(A.product_num) as total,A.product_id,cart_info')) ->whereBetweenTime('B.pay_time', $startDate, $endDate) ->where('B.mer_id', $merId) - ->where('B.paid', 1)->group('A.product_id')->limit(30)->order('total DESC')->select(); + ->where('B.paid', 1)->group('A.product_id')->limit(30)->order('total DESC')->fetchSql()->select(); $totalCount = 0; foreach ($list as $item) { $totalCount += $item['total']; @@ -168,7 +168,7 @@ class Merchant extends BaseController ->join('Merchant C', 'C.mer_id = B.mer_id') ->field(\think\facade\Db::raw('count(A.type_id) as total,B.image,B.store_name')) ->whereBetweenTime('A.create_time', $startDate, $endDate) - ->where('A.type', 'product')->where('B.mer_id', $merId)->group('A.type_id')->order('total DESC') + ->where('A.type', 'product')->where('B.mer_id', $merId)->group('A.type_id')->order('total DESC')->fetchSql() ->limit(30)->select(); $totalCount = 0; foreach ($list as $item) { @@ -200,7 +200,7 @@ class Merchant extends BaseController ->whereBetweenTime('B.create_time', $startDate, $endDate) ->where('A.mer_id', $merId) ->where('B.product_type', 0)->where('B.is_pay', 0)->where('B.is_del', 0) - ->where('B.is_new', 0)->where('B.is_fail', 0)->group('A.product_id')->limit(30)->order('total DESC')->select(); + ->where('B.is_new', 0)->where('B.is_fail', 0)->group('A.product_id')->limit(30)->order('total DESC')->fetchSql()->select(); $totalCount = 0; foreach ($list as $item) { $totalCount += $item['total'];