Explorar o código

修改故障分类

dongxiaoqin hai 8 meses
pai
achega
57cf80de79
Modificáronse 1 ficheiros con 9 adicións e 1 borrados
  1. 9 1
      app/adminapi/logic/fault_type/FaultTypeLogic.php

+ 9 - 1
app/adminapi/logic/fault_type/FaultTypeLogic.php

@@ -148,9 +148,17 @@ class FaultTypeLogic extends BaseLogic
         return FaultType::findOrEmpty($params['id'])->toArray();
     }
 
-    public static function getAllData($search = 'all')
+    public static function getAllData($search = 'all',$goods_category_id = '',$category_type = '')
     {
+        $where = [];
+        if($goods_category_id){
+            $where[] = ['goods_category_id','=',$goods_category_id];
+        }
+        if ($category_type) {
+            $where[] = ['category_type','=',$category_type];
+        }
         $data = FaultType::where('status',1)
+            ->where($where)
             ->field('id,pid,name,sort,category_type,goods_category_id')
             ->order(['sort'=> 'desc','id' => 'asc'])
             ->select()