Merge remote-tracking branch 'origin/develop' into develop

This commit is contained in:
2025-09-24 16:41:56 +08:00
2 changed files with 6 additions and 3 deletions

View File

@@ -186,7 +186,7 @@ class Room extends adminApi
$page = input('page', 1); $page = input('page', 1);
$page_limit = input('page_limit', 30); $page_limit = input('page_limit', 30);
$search_name = input('search_name', ''); $search_name = input('search_name', '');
$where=[]; $where['deletetime'] = 0;
//标签名称 //标签名称
if($search_name!==''){ if($search_name!==''){
$where['label_name'] = ['like', '%'.$search_name.'%']; $where['label_name'] = ['like', '%'.$search_name.'%'];
@@ -237,7 +237,7 @@ class Room extends adminApi
if(!$type_data){ if(!$type_data){
return V(0,"房间类型不存在"); return V(0,"房间类型不存在");
} }
$result = db::name($this->table_room_type)->where(['id'=>$type_id])->delete(); $result = db::name($this->table_room_type)->where(['id'=>$type_id])->update(['deletetime'=>time()]);
if(!$result){ if(!$result){
return V(0,"删除失败"); return V(0,"删除失败");
} }

View File

@@ -530,10 +530,13 @@ class Room extends Model
//进入房间 //进入房间
public function join_room($user_id, $room_id, $password) { public function join_room($user_id, $room_id, $password) {
$room = db::name('vs_room')->where(['id' => $room_id,'apply_status' => 2])->find(); $room = db::name('vs_room')->where(['id' => $room_id,'apply_status' => ['in',[1,2]]])->find();
if (!isset($room)) { if (!isset($room)) {
return ['code' => 0, 'msg' => '房间不存在', 'data' => '']; return ['code' => 0, 'msg' => '房间不存在', 'data' => ''];
} }
if($room['apply_status'] == 1){
return ['code' => 0, 'msg' => '房间正在审核中……', 'data' => ''];
}
if(isset($room['password']) && $user_id != $room['user_id']){ if(isset($room['password']) && $user_id != $room['user_id']){
if (empty($password) || $room['password'] != md5($password)) { if (empty($password) || $room['password'] != md5($password)) {
return ['code' => 0, 'msg' => '密码错误', 'data' => '']; return ['code' => 0, 'msg' => '密码错误', 'data' => ''];