|
|
@@ -50,16 +50,17 @@ class Home extends BaseController
|
|
50
|
50
|
-> order('sort desc')
|
|
51
|
51
|
-> group('cate_name')
|
|
52
|
52
|
-> select();
|
|
53
|
|
-
|
|
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]);
|
|
|
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
|
+ }
|
|
63
|
64
|
}
|
|
64
|
65
|
|
|
65
|
66
|
return app('json')->success($list);
|