增加全量范围字典查询
This commit is contained in:
@@ -51,4 +51,28 @@ class SysDictController extends BaseController
|
||||
$data['sysDictItem'] = SysDictItem::where('dict_id',$data['id'])->get();
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function listScopeFormat($data)
|
||||
{
|
||||
$rdata = [];
|
||||
foreach ($data as $item) {
|
||||
$rdata[$item['dict_code']] = $item['sysDictItem'];
|
||||
}
|
||||
return $rdata;
|
||||
}
|
||||
|
||||
public function listScope(Request $request)
|
||||
{
|
||||
try {
|
||||
$raw = $this->service->serviceListAllScope($request);
|
||||
$data = $this->transformData($raw, method_exists($this, 'listScopeFormat')
|
||||
? [$this, 'listScopeFormat']
|
||||
: null);
|
||||
return $this->success($data);
|
||||
} catch (\Throwable $e) {
|
||||
return $this->error($e->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user