Browse Source

客户端-暂时修复商贸区翻页问题

sunxbiao 1 year ago
parent
commit
50bc2ea364
1 changed files with 13 additions and 1 deletions
  1. 13 1
      app/controller/api/store/merchant/Merchant.php

+ 13 - 1
app/controller/api/store/merchant/Merchant.php

@@ -172,7 +172,19 @@ class Merchant extends BaseController
172
         $where['is_del'] = 0;
172
         $where['is_del'] = 0;
173
         $where['status'] = 1;
173
         $where['status'] = 1;
174
         $category_id && $where['category_id'] = $category_id;
174
         $category_id && $where['category_id'] = $category_id;
175
-        $mer_list = Db::name('merchant')->where($where)->page($page)->limit(100)->select();
175
+
176
+        $hasProductMerIdList = Db::name('store_product')
177
+            ->where('status', '=', 1)
178
+            ->where('is_show', '=', 1)
179
+            ->where('is_del', '=', 0)
180
+            ->group('mer_id')
181
+            ->field('mer_id')
182
+            ->select();
183
+        if ($hasProductMerIdList) {
184
+            $where['mer_id'] = array_column($hasProductMerIdList->toArray(), 'mer_id');
185
+        }
186
+
187
+        $mer_list = Db::name('merchant')->where($where)->page($page)->limit($limit)->select();
176
         $where['is_gift_bag'] = 0;
188
         $where['is_gift_bag'] = 0;
177
         $where['is_used'] = 1;
189
         $where['is_used'] = 1;
178
         $where['product_type'] = 0;
190
         $where['product_type'] = 0;