fix 添加项目会创建2个聊天室的问题
This commit is contained in:
@@ -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
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user