no message

This commit is contained in:
kuaifan
2021-06-04 16:16:57 +08:00
parent 81a16c235f
commit f3d4d3199f
4 changed files with 67 additions and 45 deletions

View File

@@ -42,6 +42,23 @@ class Project extends AbstractModel
{
use SoftDeletes;
/**
* @param $value
* @return int|mixed
*/
public function getDialogIdAttribute($value)
{
if ($value === 0) {
$userid = $this->projectUser->pluck('userid')->toArray();
$dialog = WebSocketDialog::createGroup($this->name, $userid, 'project');
if ($dialog) {
$this->dialog_id = $value = $dialog->id;
$this->save();
}
}
return $value;
}
/**
* @return \Illuminate\Database\Eloquent\Relations\HasMany
*/