chore(notice): 规范修复与安装演练收尾

This commit is contained in:
augushong
2026-10-12 13:40:40 +00:00
parent 3b6cb66549
commit a756b8a1cd
23 changed files with 978 additions and 981 deletions

View File

@@ -25,7 +25,7 @@ class NoticeBase extends AdminController
*/
protected const SUBSCRIBE_CHANNELS = [
NoticeService::CHANNEL_INMAIL => '站内信',
NoticeService::CHANNEL_EMAIL => '邮箱',
NoticeService::CHANNEL_EMAIL => '邮箱',
];
/**
@@ -72,10 +72,10 @@ class NoticeBase extends AdminController
->order($this->sort)
->select();
$data = [
'code' => 0,
'msg' => '',
'code' => 0,
'msg' => '',
'count' => $count,
'data' => $list,
'data' => $list,
];
return json($data);
@@ -112,11 +112,11 @@ class NoticeBase extends AdminController
$sceneTitleMap[$scene] = $info['title'];
}
$msg = [
'id' => (int) $row->id,
'title' => (string) ($notice->title ?? '(通知已删除)'),
'id' => (int) $row->id,
'title' => (string) ($notice->title ?? '(通知已删除)'),
'scene_title' => $sceneTitleMap[(string) ($notice->scene ?? '')] ?? (string) ($notice->scene ?? '-'),
'content' => (string) ($notice->content ?? ''),
'read_time' => (int) $row->read_time,
'content' => (string) ($notice->content ?? ''),
'read_time' => (int) $row->read_time,
'create_time' => (int) $row->create_time,
];
$this->assign('msg', $msg);
@@ -192,16 +192,16 @@ class NoticeBase extends AdminController
foreach (array_keys(self::SUBSCRIBE_CHANNELS) as $channel) {
$checked = $locked || ($subscribeMap[$scene . '|' . $channel] ?? 1) === 1;
$cells[] = [
'name' => 'matrix[' . $scene . '][' . $channel . ']',
'checked' => $checked ? 'checked' : '',
'name' => 'matrix[' . $scene . '][' . $channel . ']',
'checked' => $checked ? 'checked' : '',
'disabled' => $locked ? 'disabled' : '',
];
}
$matrix[] = [
'scene' => $scene,
'title' => $info['title'],
'scene' => $scene,
'title' => $info['title'],
'locked' => $locked,
'cells' => $cells,
'cells' => $cells,
];
}
@@ -251,10 +251,10 @@ class NoticeBase extends AdminController
->update(['status' => $status, 'update_time' => $now]);
} else {
Db::name('system_notice_subscribe')->insert([
'admin_id' => $adminId,
'scene' => (string) $scene,
'channel' => (string) $channel,
'status' => $status,
'admin_id' => $adminId,
'scene' => (string) $scene,
'channel' => (string) $channel,
'status' => $status,
'create_time' => $now,
'update_time' => $now,
]);