|
|
@@ -172,7 +172,19 @@ class Merchant extends BaseController
|
|
172
|
172
|
$where['is_del'] = 0;
|
|
173
|
173
|
$where['status'] = 1;
|
|
174
|
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
|
188
|
$where['is_gift_bag'] = 0;
|
|
177
|
189
|
$where['is_used'] = 1;
|
|
178
|
190
|
$where['product_type'] = 0;
|