select( 'id', 'name', 'cover', 'subtitle', 'content', 'rank', 'first_id' ); //->where('platform','psy_center'); //搜索 if(isset($condition['keywords']) && $condition['keywords']) { $query->where('name', 'like', '%'.$condition['keywords'].'%'); } if(isset($condition['category_id']) && $condition['category_id']) { $query->where('first_id', $condition['category_id']); } if(isset($condition['platform']) && $condition['platform']) { $query->where('platform', $condition['platform']); } if(isset($condition['type']) && $condition['type']) { $query->where('type', $condition['type']); } // $query->where('status', 0); //排序 $query->orderBy($sort, $sortable); return self::JsonPage($query); } }