no message

This commit is contained in:
kuaifan 2022-07-07 17:39:16 +08:00
parent 2af899cfea
commit 8ca6b53224
2 changed files with 11 additions and 5 deletions

View File

@ -290,10 +290,16 @@ class WebSocketDialog extends AbstractModel
if (!isset($this->appendattrs['groupName'])) {
$name = $this->name;
if ($this->type == "group") {
if ($this->group_type === 'project') {
$name = \DB::table('projects')->where('dialog_id', $this->id)->value('name');
} elseif ($this->group_type === 'task') {
$name = \DB::table('project_tasks')->where('dialog_id', $this->id)->value('name');
switch ($this->group_type) {
case 'project':
$name = \DB::table('projects')->where('dialog_id', $this->id)->value('name');
break;
case 'task':
$name = \DB::table('project_tasks')->where('dialog_id', $this->id)->value('name');
break;
case 'all':
$name = Base::Lang('全体成员');
break;
}
}
$this->appendattrs['groupName'] = $name;

View File

@ -15,7 +15,7 @@ class GenerateWebSocketDialogsAllGroup extends Migration
{
if (!WebSocketDialog::whereGroupType('all')->exists()) {
$userids = User::whereNull('disable_at')->pluck('userid')->toArray();
WebSocketDialog::createGroup(null, $userids, 'all');
WebSocketDialog::createGroup("全体成员 All members", $userids, 'all');
}
}