no message

This commit is contained in:
kuaifan 2022-05-17 19:55:47 +08:00
parent 3f17c0689c
commit 6347454098
2 changed files with 20 additions and 9 deletions

View File

@ -185,6 +185,7 @@ class WebSocketDialog extends AbstractModel
*/ */
public function getGroupName() public function getGroupName()
{ {
if (!isset($this->appendattrs['groupName'])) {
$name = $this->name; $name = $this->name;
if ($this->type == "group") { if ($this->type == "group") {
if ($this->group_type === 'project') { if ($this->group_type === 'project') {
@ -193,7 +194,9 @@ class WebSocketDialog extends AbstractModel
$name = \DB::table('project_tasks')->where('dialog_id', $this->id)->value('name'); $name = \DB::table('project_tasks')->where('dialog_id', $this->id)->value('name');
} }
} }
return $name; $this->appendattrs['groupName'] = $name;
}
return $this->appendattrs['groupName'];
} }
/** /**

View File

@ -195,8 +195,8 @@ class EmailNoticeTask extends AbstractTask
continue; continue;
} }
$setting = Base::setting('emailSetting'); $setting = Base::setting('emailSetting');
$msgType = $dialogType === "group" ? "群聊" : "个人"; $msgType = $dialogType === "group" ? "群聊" : "成员";
$subject = env('APP_NAME') . " 未读{$msgType}消息提醒"; $subject = null;
$content = view('email.unread', [ $content = view('email.unread', [
'type' => 'head', 'type' => 'head',
'nickname' => $user->nickname, 'nickname' => $user->nickname,
@ -227,6 +227,14 @@ class EmailNoticeTask extends AbstractTask
} }
} }
} }
if ($subject === null) {
$count = count($lists);
if ($count > 1) {
$subject = "来自{$count}{$msgType}未读消息提醒";
} else {
$subject = "来自{$dialogName}未读消息提醒";
}
}
$content .= view('email.unread', [ $content .= view('email.unread', [
'type' => 'content', 'type' => 'content',
'dialogUrl' => config("app.url") . "/manage/messenger/{$dialogId}", 'dialogUrl' => config("app.url") . "/manage/messenger/{$dialogId}",