no message

This commit is contained in:
kuaifan 2021-06-11 13:07:43 +08:00
parent 416ff1791f
commit 0e2f6db47c
5 changed files with 15 additions and 11 deletions

View File

@ -7,16 +7,12 @@ use App\Models\Project;
use App\Models\ProjectColumn;
use App\Models\ProjectLog;
use App\Models\ProjectTask;
use App\Models\ProjectTaskContent;
use App\Models\ProjectTaskUser;
use App\Models\ProjectUser;
use App\Models\User;
use App\Models\WebSocketDialogMsg;
use App\Module\Base;
use Carbon\Carbon;
use Illuminate\Support\Arr;
use Request;
use function Swoole\Coroutine\Http\get;
/**
* @apiDefine project

View File

@ -144,7 +144,7 @@ class Project extends AbstractModel
{
if ($value === 0) {
$userid = $this->projectUser->pluck('userid')->toArray();
$dialog = WebSocketDialog::createGroup($this->name, $userid, 'project');
$dialog = WebSocketDialog::createGroup('', $userid, 'project');
if ($dialog) {
$this->dialog_id = $value = $dialog->id;
$this->save();

View File

@ -52,10 +52,17 @@ class WebSocketDialog extends AbstractModel
$dialog->people = $builder->count();
// 对方信息
$dialog->dialog_user = null;
if ($dialog->type === 'user') {
$dialog_user = $builder->where('userid', '!=', $userid)->first();
$dialog->name = User::userid2nickname($dialog_user->userid);
$dialog->dialog_user = $dialog_user;
switch ($dialog->type) {
case "user":
$dialog_user = $builder->where('userid', '!=', $userid)->first();
$dialog->name = User::userid2nickname($dialog_user->userid);
$dialog->dialog_user = $dialog_user;
break;
case "group":
if ($dialog->group_type === 'project') {
$dialog->name = Project::whereDialogId($dialog->id)->value('name');
}
break;
}
return $dialog;
}

View File

@ -32,7 +32,7 @@ const method = {
return params;
},
formatDate: function(format, v) {
formatDate(format, v) {
if (typeof format === 'undefined' || format === '') {
format = 'Y-m-d H:i:s';
}

View File

@ -105,7 +105,6 @@
line-height: 24px;
> span {
flex: 1;
max-width: 130px;
color: #333333;
font-size: 14px;
white-space: nowrap;
@ -113,12 +112,14 @@
text-overflow: ellipsis;
}
> i {
flex-shrink: 0;
margin-left: 8px;
transform: scale(0.9);
font-size: 12px;
color: #87d068;
}
> em {
flex-shrink: 0;
margin-left: 8px;
font-style: normal;
color: #999999;