From 5f28e13fb5cc05ed770be313628d7bf44a254f11 Mon Sep 17 00:00:00 2001 From: u2nyakim Date: Fri, 22 Aug 2025 10:12:31 +0800 Subject: [PATCH] up. --- .../admin/system/DictionaryController.php | 72 ------------------- 1 file changed, 72 deletions(-) diff --git a/app/controller/admin/system/DictionaryController.php b/app/controller/admin/system/DictionaryController.php index 2a42521..347f220 100644 --- a/app/controller/admin/system/DictionaryController.php +++ b/app/controller/admin/system/DictionaryController.php @@ -60,76 +60,4 @@ class DictionaryController extends BaseController ]); return $this->writeSuccess('添加成功'); } - - public function dataAdd() - { - $data = $this->request->post([ - 'dictId' => null, - 'dictDataCode' => null, - 'dictDataName' => null, - 'sortNumber' => 100, - 'comments' => '' - ]); - $sysDictionary = new SysDictionaryData(); - $sysDictionary->save([ - 'dict_id' => $data['dictId'], - 'dict_data_code' => $data['dictDataCode'], - 'dict_data_name' => $data['dictDataName'], - 'sort_number' => $data['sortNumber'], - 'comments' => $data['comments'] - ]); - return $this->writeSuccess('添加成功'); - } - - public function dataUpdate() - { - $data = $this->request->put([ - 'dictDataId' => 0, - 'dictId' => null, - 'dictDataCode' => null, - 'dictDataName' => null, - 'sortNumber' => 100, - 'comments' => '' - ]); - SysDictionaryData::findOrFail($data['dictDataId'])->save([ - 'dict_id' => $data['dictId'], - 'dict_data_code' => $data['dictDataCode'], - 'dict_data_name' => $data['dictDataName'], - 'sort_number' => $data['sortNumber'], - 'comments' => $data['comments'] - ]); - return $this->writeSuccess('修改成功'); - } - - public function dataBatchRemove() - { - $data = $this->request->delete(); - SysDictionaryData::destroy($data); - return $this->writeSuccess('删除成功'); - } - - public function dataLists(): Json - { - $dictCode = $this->request->param('dictCode/s', ''); - - $data = SysDictionary::dictCodeData($dictCode); - - return $this->writeSuccess('success', $data); - } - - /** - * 查询字典集列表 - * @return Json - * @throws DbException - */ - public function dataPage(): Json - { - $paginate = CurdService::getPaginate($this->request, SysDictionaryData::withSearch(['dictId', 'dictDataName', 'dictDataCode'], [ - 'dictId' => $this->request->get('dictId/d', 0), - 'dictDataName' => $this->request->get('dictDataName/s', ''), - 'dictDataCode' => $this->request->get('dictDataCode/s', ''), - ])); - - return $this->writeSuccess('success', $paginate); - } } \ No newline at end of file