|
|
@@ -142,6 +142,53 @@ class Merchant extends BaseController
|
|
142
|
142
|
}
|
|
143
|
143
|
|
|
144
|
144
|
/**
|
|
|
145
|
+ * 商贸区店铺商品列表
|
|
|
146
|
+ * @return mixed
|
|
|
147
|
+ * @throws \think\db\exception\DataNotFoundException
|
|
|
148
|
+ * @throws \think\db\exception\DbException
|
|
|
149
|
+ * @throws \think\db\exception\ModelNotFoundException
|
|
|
150
|
+ */
|
|
|
151
|
+ public function commerceProductList()
|
|
|
152
|
+ {
|
|
|
153
|
+ $params= $this->request->params(['pageNum','pageSize']);
|
|
|
154
|
+ $mer_id_unset = [496,486,439,148,491];
|
|
|
155
|
+ $domain = $this->request->domain();
|
|
|
156
|
+ if(strpos($domain, 'test.hebeiyhc.com') !== false) {
|
|
|
157
|
+ // 域名中包含 "test.hebeiyhc.com'" 字符串
|
|
|
158
|
+ array_push($mer_id_unset, 486);
|
|
|
159
|
+ }else{
|
|
|
160
|
+ array_push($mer_id_unset, 497);
|
|
|
161
|
+ }
|
|
|
162
|
+
|
|
|
163
|
+ $is_commercetrade = 1;
|
|
|
164
|
+ [$page, $limit] = $this->getPage();
|
|
|
165
|
+ if($params['pageNum']!=''){
|
|
|
166
|
+ $page=$params['pageNum'];
|
|
|
167
|
+ }
|
|
|
168
|
+ if($params['pageSize']!=''){
|
|
|
169
|
+ $limit=$params['pageSize'];
|
|
|
170
|
+ }
|
|
|
171
|
+ $mer_list = Db::name('merchant')->where(['category_id' => 32,'status' => 1,'is_del' => 0])->page($page)->limit($limit)->select();
|
|
|
172
|
+ $where['is_gift_bag'] = 0;
|
|
|
173
|
+ $where['is_used'] = 1;
|
|
|
174
|
+ $where['product_type'] = 0;
|
|
|
175
|
+ $where['is_hide'] = 0;
|
|
|
176
|
+ $return_list = [];
|
|
|
177
|
+ if($mer_list) {
|
|
|
178
|
+ $mer_list = $mer_list->toArray();
|
|
|
179
|
+ foreach ($mer_list as $mer) {
|
|
|
180
|
+ if(in_array($mer['mer_id'],$mer_id_unset)) continue;
|
|
|
181
|
+ $goods = $this->repository->productList($mer['mer_id'],$where, 1, 3,$this->userInfo,false,$is_commercetrade);
|
|
|
182
|
+ if(empty($goods['list'])) continue;
|
|
|
183
|
+ $mer['goods_list'] = $goods['list'];
|
|
|
184
|
+ $return_list[] = $mer;
|
|
|
185
|
+ }
|
|
|
186
|
+ }
|
|
|
187
|
+ return app('json')->success(['list'=>$return_list]);
|
|
|
188
|
+
|
|
|
189
|
+ }
|
|
|
190
|
+
|
|
|
191
|
+ /**
|
|
145
|
192
|
* 查询代理人商品
|
|
146
|
193
|
* @param $type
|
|
147
|
194
|
* @return mixed
|