fix 添加项目会创建2个聊天室的问题

This commit is contained in:
kuaifan
2021-07-03 12:23:31 +08:00
parent 9f06074470
commit 85652d0f1a
2 changed files with 6 additions and 20 deletions
-20
View File
@@ -165,26 +165,6 @@ class Project extends AbstractModel
return $this->appendattrs['owner_userid'];
}
/**
* @param $value
* @return int|mixed
*/
public function getDialogIdAttribute($value)
{
if ($value === 0 && $this->id) {
return AbstractModel::transaction(function() {
$this->lockForUpdate();
$dialog = WebSocketDialog::createGroup(null, $this->relationUserids(), 'project');
if ($dialog) {
$this->dialog_id = $dialog->id;
$this->save();
}
return $dialog->id;
});
}
return $value;
}
/**
* @return \Illuminate\Database\Eloquent\Relations\HasMany
*/