|
|
@@ -225,20 +225,20 @@ class Merchant extends BaseController
|
|
225
|
225
|
->group('mer_id')
|
|
226
|
226
|
->field('mer_id')
|
|
227
|
227
|
->select();
|
|
228
|
|
- return app('json')->success($hasProductMerIdList);
|
|
229
|
|
-// if ($hasProductMerIdList) {
|
|
230
|
|
-// $hasProductMerIdList = array_column($hasProductMerIdList->toArray(), 'mer_id');
|
|
231
|
|
-// }
|
|
232
|
|
-// $query = Db::name('merchant')->where($where);
|
|
233
|
|
-// if (!empty($hasProductMerIdList) && is_array($hasProductMerIdList)) {
|
|
234
|
|
-// $query->whereIn('mer_id', $hasProductMerIdList);
|
|
235
|
|
-// }
|
|
236
|
|
-// $mer_list = $query->page($page)->limit($limit)->select();
|
|
237
|
|
-// $where['is_gift_bag'] = 0;
|
|
238
|
|
-// $where['is_used'] = 1;
|
|
239
|
|
-// $where['product_type'] = 0;
|
|
240
|
|
-// $where['is_hide'] = 0;
|
|
241
|
|
-// $return_list = [];
|
|
|
228
|
+ if ($hasProductMerIdList) {
|
|
|
229
|
+ $hasProductMerIdList = array_column($hasProductMerIdList->toArray(), 'mer_id');
|
|
|
230
|
+ }
|
|
|
231
|
+ $query = Db::name('merchant')->where($where);
|
|
|
232
|
+ if (!empty($hasProductMerIdList) && is_array($hasProductMerIdList)) {
|
|
|
233
|
+ $query->whereIn('mer_id', $hasProductMerIdList);
|
|
|
234
|
+ }
|
|
|
235
|
+ $mer_list = $query->page($page)->limit($limit)->select();
|
|
|
236
|
+ $where['is_gift_bag'] = 0;
|
|
|
237
|
+ $where['is_used'] = 1;
|
|
|
238
|
+ $where['product_type'] = 0;
|
|
|
239
|
+ $where['is_hide'] = 0;
|
|
|
240
|
+ $return_list = [];
|
|
|
241
|
+ return app('json')->success(['list'=>$mer_list]);
|
|
242
|
242
|
// if($mer_list) {
|
|
243
|
243
|
// $mer_list = $mer_list->toArray();
|
|
244
|
244
|
// foreach ($mer_list as $mer) {
|