From ea07b49995ed63949946d1a88cf799d6002ad0fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E5=8D=8E=E6=B8=85?= <18691022700@163.com> Date: Thu, 21 Aug 2025 14:44:42 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=88=BF=E9=97=B4=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E4=B8=BA=E7=8E=B0=E6=9C=89=E7=B1=BB=E5=9E=8B=20=20?= =?UTF-8?q?=E5=81=9A=E6=8B=A6=E6=88=AA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/api/model/Room.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/application/api/model/Room.php b/application/api/model/Room.php index 547a5e9..33c36b8 100644 --- a/application/api/model/Room.php +++ b/application/api/model/Room.php @@ -1688,6 +1688,12 @@ class Room extends Model if(!$owner && !$host){ 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(); if($type == 1 || $type == 3 || $type == 4){