|
|
@@ -31,7 +31,8 @@ class Home extends BaseController
|
|
31
|
31
|
//大仓分类
|
|
32
|
32
|
public function classify(){
|
|
33
|
33
|
|
|
34
|
|
- $merid=$this->merId;
|
|
|
34
|
+ // $merid=$this->merId;
|
|
|
35
|
+ $merid = $this->request->param('mer_id');
|
|
35
|
36
|
$cate_arr=[];
|
|
36
|
37
|
$list = Db::name('store_category')
|
|
37
|
38
|
-> where('is_show',1)
|
|
|
@@ -49,6 +50,19 @@ class Home extends BaseController
|
|
49
|
50
|
-> order('sort desc')
|
|
50
|
51
|
-> group('cate_name')
|
|
51
|
52
|
-> select();
|
|
|
53
|
+ if ($merid) {
|
|
|
54
|
+ foreach ($list as $key => $item) {
|
|
|
55
|
+ $product = Db::name('store_product')
|
|
|
56
|
+ ->where('is_show',1)
|
|
|
57
|
+ ->where('status',1)
|
|
|
58
|
+ ->where('mer_id',$merid)
|
|
|
59
|
+ ->where('cate_id',$item['store_category_id'])
|
|
|
60
|
+ ->limit(1)
|
|
|
61
|
+ ->find();
|
|
|
62
|
+ if(!$product) unset($list[$key]);
|
|
|
63
|
+ }
|
|
|
64
|
+ }
|
|
|
65
|
+
|
|
52
|
66
|
return app('json')->success($list);
|
|
53
|
67
|
|
|
54
|
68
|
}
|