Browse Source

Merge branch 'dev'

shichen 2 months ago
parent
commit
616cf22209
1 changed files with 15 additions and 1 deletions
  1. 15 1
      app/controller/api/warehouse/Home.php

+ 15 - 1
app/controller/api/warehouse/Home.php

@@ -31,7 +31,8 @@ class Home extends BaseController
31
     //大仓分类
31
     //大仓分类
32
     public function classify(){
32
     public function classify(){
33
 
33
 
34
-        $merid=$this->merId;
34
+        // $merid=$this->merId;
35
+        $merid = $this->request->param('mer_id');
35
         $cate_arr=[];
36
         $cate_arr=[];
36
         $list = Db::name('store_category')
37
         $list = Db::name('store_category')
37
             -> where('is_show',1)
38
             -> where('is_show',1)
@@ -49,6 +50,19 @@ class Home extends BaseController
49
             -> order('sort desc')
50
             -> order('sort desc')
50
             -> group('cate_name')
51
             -> group('cate_name')
51
             -> select();
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
         return app('json')->success($list);
66
         return app('json')->success($list);
53
 
67
 
54
     }
68
     }