mirror of
https://github.com/renbaoshuo/S2OJ.git
synced 2024-10-09 12:04:07 +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,
|
||||
`priority` int NOT NULL DEFAULT 0,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `send_time` (`send_time`)
|
||||
KEY `send_time` (`send_time`),
|
||||
KEY `priority` (`priority`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
|
||||
/*!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>用户代理: {$user_agent}</li>
|
||||
</ul>
|
||||
EOD);
|
||||
EOD, 5);
|
||||
|
||||
DB::update([
|
||||
"update user_info",
|
||||
|
@ -210,11 +210,11 @@ function sendSystemMsg($username, $title, $content) {
|
||||
sendEmail($username, $title, $content);
|
||||
}
|
||||
|
||||
function sendEmail($username, $title, $content) {
|
||||
function sendEmail($username, $title, $content, $priority = 0) {
|
||||
DB::insert([
|
||||
"insert into emails",
|
||||
"(receiver, subject, content, created_at)",
|
||||
"values", DB::tuple([$username, $title, $content, DB::now()])
|
||||
"(receiver, subject, content, created_at, priority)",
|
||||
"values", DB::tuple([$username, $title, $content, DB::now(), $priority])
|
||||
]);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user