selectField = ['id', 'name', 'value', 'pid', 'desc', 'created_at', 'updated_at', 'deleted_at']; $this->model = RoleModel::class; } /** * 获取项目列表 * @return array * @throws ContainerExceptionInterface * @throws NotFoundExceptionInterface */ public function list(): array { return $this->getPageList(); } public function detail($id) { return $this->getDetail($id); } /** * 项目下拉列表 * @return mixed */ public function option() { $this->optionField = ['id', 'name']; return $this->getOption(); } /** * 创建项目 * @param $params * @return mixed * @throws Exception */ public function create($params): mixed { return $this->insert($params); } /** * 编辑项目 * @param $id * @param $params * @return mixed * @throws Exception */ public function update($id, $params): mixed { return $this->save($id, $params); } /** * 删除项目 * @param $ids * @return mixed|true * @throws Exception */ public function delete($ids): mixed { return $this->del($ids); } }