bug 修改
This commit is contained in:
@@ -222,7 +222,7 @@ class Room extends BaseCom
|
||||
{
|
||||
$room_id = input('room_id', 0);
|
||||
$page = input('page', 1);
|
||||
$limit = input('limit', 5);
|
||||
$limit = input('limit', 15);
|
||||
$reslut = model('Room')->room_online_list($room_id, $page, $limit);
|
||||
return V($reslut['code'], $reslut['msg'], $reslut['data']);
|
||||
}
|
||||
|
||||
@@ -38,12 +38,15 @@ class Sign extends BaseCom
|
||||
//签约开始
|
||||
public function start_sign()
|
||||
{
|
||||
$key_name = "api:sign:start_sign:" . $this->uid;
|
||||
redis_lock_exit($key_name);
|
||||
$room_id = input('room_id', 0);
|
||||
$user_id = input('user_id', 0);
|
||||
if ($room_id <= 0 || $user_id <= 0) {
|
||||
return V(0, '参数错误');
|
||||
}
|
||||
$reslut = model('Sign')->start_sign($this->uid, $room_id, $user_id);
|
||||
redis_unlock($key_name);
|
||||
return V($reslut['code'], $reslut['msg'], $reslut['data']);
|
||||
}
|
||||
|
||||
|
||||
@@ -1778,7 +1778,7 @@ class Room extends Model
|
||||
|
||||
|
||||
//房间在线列表
|
||||
public function room_online_list($room_id, $page = 1, $limit = 5)
|
||||
public function room_online_list($room_id, $page = 1, $limit = 15)
|
||||
{
|
||||
if (!$room_id) {
|
||||
return ['code' => 0, 'msg' => '参数错误'];
|
||||
|
||||
@@ -26,6 +26,12 @@ class Sign extends Model
|
||||
return ['code' => 0, 'msg' => '签约麦位没有用户', 'data' => null];
|
||||
}
|
||||
|
||||
//判断房间内是否有正在签约的
|
||||
$is_sign = db::name('vs_room_sign')->where(['room_id' => $room_id,'sign_type' => 1])->count();
|
||||
if($is_sign > 0){
|
||||
return ['code' => 0, 'msg' => '房间内已有签约', 'data' => null];
|
||||
}
|
||||
|
||||
$is_first_sign = db::name('vs_user_sign')->where('sign_user_id',$sign_user_id)->count();
|
||||
if($is_first_sign < 1){
|
||||
//第一次被签默认时长
|
||||
|
||||
Reference in New Issue
Block a user