query('SELECT id,username FROM users')->fetchAll() as $u) { $usersMap[(int)$u['id']] = (string)$u['username']; } $statusOptions = ['pending' => '待审批', 'approved' => '已通过', 'rejected' => '已驳回']; $statusPillMap = ['pending' => 'due', 'approved' => 'ok', 'rejected' => 'done']; $typeLabelMap = ['archive' => '档案', 'archive_batch' => '批量档案']; $targetOptions = []; $requesterOptions = []; foreach ($allApprovals as $ap) { $tid = (string)($ap['target_id'] ?? ''); if ($tid !== '' && !isset($targetOptions[$tid])) { $aid = (int)$tid; $targetOptions[$tid] = 'ID:' . $aid . (isset($archiveMap[$aid]) ? ' · ' . (string)$archiveMap[$aid]['name'] : ''); } $rname = trim((string)($ap['requested_name'] ?? '')); if ($rname !== '') { $requesterOptions[$rname] = true; } } $hasFilter = $filterStatus !== 'pending' || $filterTarget !== '' || $filterRequester !== ''; pageHeader($me); ?>
| 申请时间 | 删除目标 | 类型 | 申请人 | 状态 | 审批操作 |
|---|---|---|---|---|---|
| = e((string)$ap['requested_at']) ?> |
= e(approvalTargetLabel($ap, $archiveMap)) ?>
申请单号 = e((string)$ap['id']) ?>
|
= e($typeLabelMap[(string)($ap['target_type'] ?? '')] ?? (string)($ap['target_type'] ?? '')) ?> | = e((string)$ap['requested_name']) ?> | = e($statusOptions[$st] ?? $st) ?> |
已处理
申请人不能自审
|