Explorar el Código

小程序app-商贸区-检测问题

xupuyuan hace 8 meses
padre
commit
987d7db287
Se han modificado 1 ficheros con 40 adiciones y 58 borrados
  1. 40 58
      app/controller/api/store/merchant/Merchant.php

+ 40 - 58
app/controller/api/store/merchant/Merchant.php

@@ -195,65 +195,47 @@ class Merchant extends BaseController
195
      */
195
      */
196
     public function commerceProductList()
196
     public function commerceProductList()
197
     {
197
     {
198
-        $params= $this->request->params(['pageNum','pageSize','category_id']);
199
-        $mer_id_unset = [496,486,439,148,491];
200
-        $domain = $this->request->domain();
201
-        if(strpos($domain, 'test.hebeiyhc.com') !== false) {
202
-            // 域名中包含 "test.hebeiyhc.com'" 字符串
203
-            array_push($mer_id_unset, 486);
204
-        }else{
205
-            array_push($mer_id_unset, 497);
206
-        }
207
-
208
-        $is_commercetrade = 1;
209
-        [$page, $limit] = $this->getPage();
210
-        if($params['pageNum']!=''){
211
-            $page=$params['pageNum'];
212
-        }
213
-        if($params['pageSize']!=''){
214
-            $limit=$params['pageSize'];
215
-        }
216
-        $category_id = $params['category_id']?:0;
217
-        $where['is_del'] = 0;
218
-        $where['status'] = 1;
219
-        $category_id && $where['category_id'] = $category_id;
220
-
221
-        $hasProductMerIdList = Db::name('store_product')
222
-            ->where('status', '=', 1)
223
-            ->where('is_show', '=', 1)
224
-            ->where('is_del', '=', 0)
225
-            ->group('mer_id')
226
-            ->field('mer_id')
227
-            ->select();
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
-        return app('json')->success(['list'=>$mer_list]);
237
-//        $where['is_gift_bag'] = 0;
238
-//        $where['is_used'] = 1;
239
-//        $where['product_type'] = 0;
240
-//        $where['is_hide'] = 0;
241
-//        $return_list = [];
242
-//        if($mer_list) {
243
-//            $mer_list = $mer_list->toArray();
244
-//            foreach ($mer_list as $mer) {
245
-//                if(in_array($mer['mer_id'],$mer_id_unset)) continue;
246
-//                $goods = $this->repository->productList($mer['mer_id'],$where, 1, 3,$this->userInfo,false,$is_commercetrade);
247
-//                if(empty($goods['list'])) continue;
248
-//                $mer['goods_list'] = $goods['list'];
249
-//                if (mb_strlen($mer['mer_name']) > 8) {
250
-//                    $mer['mer_name'] = mb_substr($mer['mer_name'], 0, 8) . '...';
251
-//                }
252
-//                $return_list[] = $mer;
253
-//            }
198
+        $hajimi = Db::name('merchant')->where('mer_id',3478)->find();
199
+        return app('json')->success($hajimi);
200
+//        $params= $this->request->params(['pageNum','pageSize','category_id']);
201
+//        $mer_id_unset = [496,486,439,148,491];
202
+//        $domain = $this->request->domain();
203
+//        if(strpos($domain, 'test.hebeiyhc.com') !== false) {
204
+//            // 域名中包含 "test.hebeiyhc.com'" 字符串
205
+//            array_push($mer_id_unset, 486);
206
+//        }else{
207
+//            array_push($mer_id_unset, 497);
254
 //        }
208
 //        }
255
-//        return app('json')->success(['list'=>$return_list]);
256
-
209
+//
210
+//        $is_commercetrade = 1;
211
+//        [$page, $limit] = $this->getPage();
212
+//        if($params['pageNum']!=''){
213
+//            $page=$params['pageNum'];
214
+//        }
215
+//        if($params['pageSize']!=''){
216
+//            $limit=$params['pageSize'];
217
+//        }
218
+//        $category_id = $params['category_id']?:0;
219
+//        $where['is_del'] = 0;
220
+//        $where['status'] = 1;
221
+//        $category_id && $where['category_id'] = $category_id;
222
+//
223
+//        $hasProductMerIdList = Db::name('store_product')
224
+//            ->where('status', '=', 1)
225
+//            ->where('is_show', '=', 1)
226
+//            ->where('is_del', '=', 0)
227
+//            ->group('mer_id')
228
+//            ->field('mer_id')
229
+//            ->select();
230
+//        if ($hasProductMerIdList) {
231
+//            $hasProductMerIdList = array_column($hasProductMerIdList->toArray(), 'mer_id');
232
+//        }
233
+//        $query = Db::name('merchant')->where($where);
234
+//        if (!empty($hasProductMerIdList) && is_array($hasProductMerIdList)) {
235
+//            $query->whereIn('mer_id', $hasProductMerIdList);
236
+//        }
237
+//        $mer_list = $query->page($page)->limit($limit)->select();
238
+//        return app('json')->success(['list'=>$mer_list]);
257
     }
239
     }
258
 
240
 
259
     /**
241
     /**