dataRange() ->catchSearch() ->order($this->aliasField($field), $order) ->paginate(); return $res; } //根据名称搜索 public function searchNameAttr($query, $value, $data) { return $query->where('name', 'like', '%'.$value.'%'); } //根据状态搜索 public function searchStatusAttr($query, $value, $data) { return $query->where('status',$value); } }