erge branch '11-5' of http://git.zhenyangtang.com.cn/ZYT/zyt

it stash pop
This commit is contained in:
gr
2026-11-06 12:02:54 +08:00
20 changed files with 2338 additions and 36 deletions
@@ -80,6 +80,17 @@ class AuthMiddleware
// 当前访问路径
$accessUri = strtolower($request->controller() . '/' . $request->action());
// 患者列表的部门筛选复用列表权限;只允许 GET 查询显式启用数据范围的部门树。
// 必须与 DeptController::all 读取同一个 GET 参数,避免请求体参数意外放行全量部门。
if ($accessUri === 'dept.dept/all'
&& $request->isGet()
&& in_array($request->get('apply_data_scope'), [1, '1'], true)) {
$uris = $this->formatUrl($adminAuthCache->getAdminUri() ?? []);
if (in_array('tcm.diagnosis/lists', $uris, true)) {
return $next($request);
}
}
// Screenshot analysis shares the assistant grant and must never use the
// unregistered-route bypass, even before menus have been synchronized.
if ($accessUri === 'tcm.diagnosis/aitonguescreenshot') {
@@ -184,6 +184,21 @@ class DiagnosisLists extends BaseAdminDataLists implements ListsSearchInterface
->limit($this->limitOffset, $this->limitLength)
->select()
->toArray();
// 仅补充已通过权限过滤且落在本页的医助姓名,不依赖调用者拥有后台人员列表权限。
$assistantIds = array_values(array_unique(array_filter(array_map(
'intval',
array_column($lists, 'assistant_id')
), static function (int $id): bool {
return $id > 0;
})));
$assistantNames = $assistantIds === []
? []
: Admin::whereIn('id', $assistantIds)->whereNull('delete_time')->column('name', 'id');
foreach ($lists as &$item) {
$item['assistant_name'] = trim((string) ($assistantNames[(int) ($item['assistant_id'] ?? 0)] ?? ''));
}
unset($item);
// 关联挂号:doctor_appointment.patient_id 存诊单主键 id(与 Appointment 列表 join 一致)
$diagnosisIds = array_filter(array_unique(array_column($lists, 'id')));