feat: email send priority

This commit is contained in:
Baoshuo Ren 2023-02-13 20:32:00 +08:00
parent 8c189fd9eb
commit dfd4156aef
Signed by: baoshuo
GPG Key ID: 00CB9680AB29F51A
3 changed files with 6 additions and 5 deletions

View File

@ -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 */;

View File

@ -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",

View File

@ -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])
]);
}