练歌房首页类型列表 修改房间类型
This commit is contained in:
@@ -32,6 +32,8 @@ class Index extends BaseCom
|
||||
$list = db::name('vs_room_type')->where(['status' => 1, 'deletetime' => 0])->field('id,type_name as label_name')->order('sort asc')->select();
|
||||
//给前面添加一组数据
|
||||
array_unshift($list, ['id' => -1, 'label_name' => '热门']);
|
||||
//给后面添加一组数据
|
||||
array_push($list, ['id' => -2, 'label_name' => '练歌']);
|
||||
return V(1, '获取成功', $list);
|
||||
}
|
||||
|
||||
|
||||
@@ -35,15 +35,6 @@ class Room extends BaseCom
|
||||
return V($reslut['code'], $reslut['msg'], $reslut['data']);
|
||||
}
|
||||
|
||||
//关注的用户现在所在房间(废弃)
|
||||
public function user_follow_in_room_list()
|
||||
{
|
||||
$page = input('page', 1);
|
||||
$page_limit = input('page_limit', 15);
|
||||
|
||||
$reslut = model('Room')->user_follow_in_room_list($this->uid, $page, $page_limit);
|
||||
return V($reslut['code'], $reslut['msg'], $reslut['data']);
|
||||
}
|
||||
|
||||
//房间随机名称
|
||||
public function room_random_name()
|
||||
@@ -315,16 +306,6 @@ class Room extends BaseCom
|
||||
return V($reslut['code'], $reslut['msg'], $reslut['data']);
|
||||
}
|
||||
|
||||
//禁麦 \解禁
|
||||
// public function set_mute_pit()
|
||||
// {
|
||||
// $room_id = input('room_id', 0);
|
||||
// $pit_number = input('pit_number', 0);
|
||||
// $is_mute = input('is_mute', 0);//0 未禁麦 1已
|
||||
// $reslut = model('Room')->set_mute_pit($this->uid, $room_id, $pit_number,$is_mute);
|
||||
// return V($reslut['code'], $reslut['msg'], $reslut['data']);
|
||||
// }
|
||||
|
||||
//锁麦\解锁
|
||||
public function set_lock_pit()
|
||||
{
|
||||
@@ -431,18 +412,6 @@ class Room extends BaseCom
|
||||
return V($reslut['code'], $reslut['msg'], $reslut['data']);
|
||||
}
|
||||
|
||||
// //创建房间
|
||||
// public function create_rooms()
|
||||
// {
|
||||
// //查询所有的房间信息
|
||||
// $room = db::name('vs_room')->field('id,user_id')->where(['room_status' => ['<>',3]])->select();
|
||||
// $i = 0;
|
||||
// foreach ($room as $value) {
|
||||
// $reslut = model('Tencent')->create_group($value['user_id'],'room'.$value['id']);
|
||||
// $i++;
|
||||
// }
|
||||
// return['code' => 1, 'msg' => '成功创建了'.$i.'个房间', 'data' => null];
|
||||
// }
|
||||
|
||||
//用户重连
|
||||
public function user_reconnect()
|
||||
|
||||
@@ -192,10 +192,14 @@ class Room extends Model
|
||||
if(!empty($label_id) && $label_id > 0){
|
||||
$map['type_id'] = $label_id;
|
||||
}
|
||||
if(!empty($label_id) && $label_id < 0){
|
||||
if(!empty($label_id) && $label_id == -1){
|
||||
$map['is_hot'] = 2;
|
||||
}
|
||||
|
||||
if(!empty($label_id) && $label_id == -2){
|
||||
$map['label_id'] = 2;
|
||||
}
|
||||
|
||||
if($is_top == 2){
|
||||
$map['is_top'] = $is_top;
|
||||
}
|
||||
@@ -1671,7 +1675,7 @@ class Room extends Model
|
||||
}
|
||||
|
||||
$roomInfo = db::name('vs_room')->where(['id' => $room_id])->find();
|
||||
if($roomInfo['type_id'] == $type){
|
||||
if($roomInfo['type_id'] == $type && $roomInfo['type_id'] != 1){
|
||||
return ['code' => 0, 'msg' => '房间类型已存在', 'data' => null];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user