where('category_type','=',$params['category_type']); return $model->order(['sort' => 'asc', 'create_time' => 'asc'])->select(); } /** * 分类类型文本 */ public function getTypeTextAttr($value, $data) { return (new SupplierType())::getName($data['category_type']); } /** * 详情 */ public static function detail($category_id) { return (new static())->find($category_id); } }