mirror of
https://github.com/renbaoshuo/S2OJ.git
synced 2024-11-24 20:18:45 +00:00
feat: email send priority
This commit is contained in:
parent
8c189fd9eb
commit
dfd4156aef
@ -444,7 +444,8 @@ CREATE TABLE `emails` (
|
|||||||
`send_time` datetime DEFAULT NULL,
|
`send_time` datetime DEFAULT NULL,
|
||||||
`priority` int NOT NULL DEFAULT 0,
|
`priority` int NOT NULL DEFAULT 0,
|
||||||
PRIMARY KEY (`id`),
|
PRIMARY KEY (`id`),
|
||||||
KEY `send_time` (`send_time`)
|
KEY `send_time` (`send_time`),
|
||||||
|
KEY `priority` (`priority`)
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
|
||||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||||
|
|
||||||
|
@ -72,7 +72,7 @@ $forgot_form->handle = function (&$vdata) {
|
|||||||
<li>转发源 IP:{$http_x_forwarded_for} </li>
|
<li>转发源 IP:{$http_x_forwarded_for} </li>
|
||||||
<li>用户代理: {$user_agent}</li>
|
<li>用户代理: {$user_agent}</li>
|
||||||
</ul>
|
</ul>
|
||||||
EOD);
|
EOD, 5);
|
||||||
|
|
||||||
DB::update([
|
DB::update([
|
||||||
"update user_info",
|
"update user_info",
|
||||||
|
@ -210,11 +210,11 @@ function sendSystemMsg($username, $title, $content) {
|
|||||||
sendEmail($username, $title, $content);
|
sendEmail($username, $title, $content);
|
||||||
}
|
}
|
||||||
|
|
||||||
function sendEmail($username, $title, $content) {
|
function sendEmail($username, $title, $content, $priority = 0) {
|
||||||
DB::insert([
|
DB::insert([
|
||||||
"insert into emails",
|
"insert into emails",
|
||||||
"(receiver, subject, content, created_at)",
|
"(receiver, subject, content, created_at, priority)",
|
||||||
"values", DB::tuple([$username, $title, $content, DB::now()])
|
"values", DB::tuple([$username, $title, $content, DB::now(), $priority])
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user