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\ProjectColumn;
use App\Models\ProjectLog; use App\Models\ProjectLog;
use App\Models\ProjectTask; use App\Models\ProjectTask;
use App\Models\ProjectTaskContent;
use App\Models\ProjectTaskUser;
use App\Models\ProjectUser; use App\Models\ProjectUser;
use App\Models\User; use App\Models\User;
use App\Models\WebSocketDialogMsg;
use App\Module\Base; use App\Module\Base;
use Carbon\Carbon; use Carbon\Carbon;
use Illuminate\Support\Arr; use Illuminate\Support\Arr;
use Request; use Request;
use function Swoole\Coroutine\Http\get;
/** /**
* @apiDefine project * @apiDefine project

View File

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

View File

@ -52,10 +52,17 @@ class WebSocketDialog extends AbstractModel
$dialog->people = $builder->count(); $dialog->people = $builder->count();
// 对方信息 // 对方信息
$dialog->dialog_user = null; $dialog->dialog_user = null;
if ($dialog->type === 'user') { switch ($dialog->type) {
$dialog_user = $builder->where('userid', '!=', $userid)->first(); case "user":
$dialog->name = User::userid2nickname($dialog_user->userid); $dialog_user = $builder->where('userid', '!=', $userid)->first();
$dialog->dialog_user = $dialog_user; $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; return $dialog;
} }

View File

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

View File

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