字典分类

This commit is contained in:
2025-09-02 14:47:21 +08:00
parent c1fb484e24
commit aa5619f405
3 changed files with 29 additions and 9 deletions
@@ -75,4 +75,17 @@ class SysDictController extends BaseController
return $this->error($e->getMessage());
}
}
public function group(Request $request)
{
try {
$raw = $this->service->group($request);
$data = $this->transformData($raw, method_exists($this, 'groupFormat')
? [$this, 'groupFormat']
: null);
return $this->success($data);
} catch (\Throwable $e) {
return $this->error($e->getMessage());
}
}
}
+14
View File
@@ -87,11 +87,25 @@ class SysDictService
$config['with']['sysDictItem'][] = 'item_label';
$config['with']['sysDictItem'][] = 'item_value';
break;
case 'group':
$config['order']['id'] = 'desc';
$config['where']['id'] = 1;
$config['with']['sysDictItem'][] = 'dict_id';
$config['with']['sysDictItem'][] = 'item_label';
$config['with']['sysDictItem'][] = 'item_value';
break;
}
return $config;
}
public function group(Request $request)
{
$config = $this->buildQueryConfig($request, 'group');
$result = $this->logicListAll($config);
return $this->postProcess('group', $result);
}
public function serviceListAllScope(Request $request)
{