Selaa lähdekoodia

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

sunxbiao 1 vuosi sitten
vanhempi
commit
2c746e8e2e
1 muutettua tiedostoa jossa 6 lisäystä ja 3 poistoa
  1. 6 3
      app/controller/api/store/merchant/Merchant.php

+ 6 - 3
app/controller/api/store/merchant/Merchant.php

@@ -181,10 +181,13 @@ class Merchant extends BaseController
181
             ->field('mer_id')
181
             ->field('mer_id')
182
             ->select();
182
             ->select();
183
         if ($hasProductMerIdList) {
183
         if ($hasProductMerIdList) {
184
-            $where['mer_id'] = array_column($hasProductMerIdList->toArray(), 'mer_id');
184
+            $hasProductMerIdList = array_column($hasProductMerIdList->toArray(), 'mer_id');
185
         }
185
         }
186
-
187
-        $mer_list = Db::name('merchant')->where($where)->page($page)->limit($limit)->select();
186
+        $query = Db::name('merchant')->where($where);
187
+        if (!empty($hasProductMerIdList) && is_array($hasProductMerIdList)) {
188
+            $query->whereIn('mer_id', $hasProductMerIdList);
189
+        }
190
+        $mer_list = $query->page($page)->limit($limit)->select();
188
         $where['is_gift_bag'] = 0;
191
         $where['is_gift_bag'] = 0;
189
         $where['is_used'] = 1;
192
         $where['is_used'] = 1;
190
         $where['product_type'] = 0;
193
         $where['product_type'] = 0;