|
@@ -148,9 +148,17 @@ class FaultTypeLogic extends BaseLogic
|
|
|
return FaultType::findOrEmpty($params['id'])->toArray();
|
|
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)
|
|
$data = FaultType::where('status',1)
|
|
|
|
|
+ ->where($where)
|
|
|
->field('id,pid,name,sort,category_type,goods_category_id')
|
|
->field('id,pid,name,sort,category_type,goods_category_id')
|
|
|
->order(['sort'=> 'desc','id' => 'asc'])
|
|
->order(['sort'=> 'desc','id' => 'asc'])
|
|
|
->select()
|
|
->select()
|