修改房间类型为现有类型 做拦截
This commit is contained in:
@@ -1688,6 +1688,12 @@ class Room extends Model
|
|||||||
if(!$owner && !$host){
|
if(!$owner && !$host){
|
||||||
return ['code' => 0, 'msg' => '没有权限操作', 'data' => null];
|
return ['code' => 0, 'msg' => '没有权限操作', 'data' => null];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$roomInfo = db::name('vs_room')->where(['id' => $room_id])->find();
|
||||||
|
if($roomInfo['type_id'] == $type){
|
||||||
|
return ['code' => 0, 'msg' => '房间类型已存在', 'data' => null];
|
||||||
|
}
|
||||||
|
|
||||||
//开启事务
|
//开启事务
|
||||||
db::startTrans();
|
db::startTrans();
|
||||||
if($type == 1 || $type == 3 || $type == 4){
|
if($type == 1 || $type == 3 || $type == 4){
|
||||||
|
|||||||
Reference in New Issue
Block a user