wesmiler 6 дней назад
Родитель
Сommit
c3e927baa7
1 измененных файлов с 6 добавлено и 2 удалено
  1. 6 2
      app/Services/Common/GoodsCategoryService.php

+ 6 - 2
app/Services/Common/GoodsCategoryService.php

@@ -275,11 +275,15 @@ class GoodsCategoryService extends BaseService
      */
     public function options()
     {
-        $map = [['mark', '=', 1], ['status', '=', 1]];
+        $type = request()->post('type',0);
+        $map = ['type'=>$type,'status'=>1,'mark'=>1];
+        if($type<=0){
+           unset($map['type']);
+        }
         $list = $this->model->where($map)
             ->orderBy('sort', 'desc')
             ->orderBy('id', 'asc')
-            ->select(['id', 'name', 'pid', 'icon'])
+            ->select(['id', 'name','type', 'pid', 'icon'])
             ->get()
             ->toArray();