师徒任务跳转房间
This commit is contained in:
@@ -138,4 +138,10 @@ class Sign extends BaseCom
|
||||
return V(1, '成功', $skill_list);
|
||||
}
|
||||
|
||||
//获取首次被签约且在约期内的徒弟列表
|
||||
public function get_first_sign_student_list()
|
||||
{
|
||||
$reslut = model('Sign')->get_first_sign_student_list($this->uid);
|
||||
return V($reslut['code'], $reslut['msg'], $reslut['data']);
|
||||
}
|
||||
}
|
||||
@@ -3277,4 +3277,91 @@ class Room extends Model
|
||||
|
||||
return ['code' => 1, 'msg' => '操作成功', 'data' => null];
|
||||
}
|
||||
|
||||
|
||||
//任务跳转房间推荐
|
||||
public function task_jump_room_recommend($task_id)
|
||||
{
|
||||
if($task_id == 6 || $task_id == 16){
|
||||
//签约房间
|
||||
$room_ids = db::name('vs_room')->where(['type_id' => 10,'room_status' => 1])->column('id');
|
||||
if(!$room_ids){
|
||||
return 0;
|
||||
}
|
||||
//在上面获取 一个随机的id
|
||||
return $room_ids[array_rand($room_ids)];
|
||||
}
|
||||
if($task_id == 9){
|
||||
//拍卖
|
||||
$room_ids = db::name('vs_room')->where(['type_id' => 2,'room_status' => 1])->column('id');
|
||||
if(!$room_ids){
|
||||
return 0;
|
||||
}
|
||||
//在上面获取 一个随义的id
|
||||
return $room_ids[array_rand($room_ids)];
|
||||
}
|
||||
if($task_id == 10){
|
||||
//互娱
|
||||
$room_ids = db::name('vs_room')->where(['type_id' => 7,'room_status' => 1])->column('id');
|
||||
if(!$room_ids){
|
||||
return 0;
|
||||
}
|
||||
//在上面获取 一个随义的id
|
||||
return $room_ids[array_rand($room_ids)];
|
||||
}
|
||||
if($task_id == 15){
|
||||
//点歌
|
||||
$room_ids = db::name('vs_room')->where(['type_id' => 9,'room_status' => 1])->column('id');
|
||||
if(!$room_ids){
|
||||
return 0;
|
||||
}
|
||||
//在上面获取 一个随义的id
|
||||
return $room_ids[array_rand($room_ids)];
|
||||
}
|
||||
if($task_id == 21){
|
||||
//拍卖 且有人有热度
|
||||
$room_ids = db::name('vs_room')->alias('a')->join('vs_room_visitor b','a.id = b.room_id','right')
|
||||
->where(['a.type_id' => 2,'a.room_status' => 1,'a.today_hot_value' => ['>',0],'b.user_id' => ['<>',0]])
|
||||
->column('a.id');
|
||||
if(!$room_ids){
|
||||
return 0;
|
||||
}
|
||||
//在上面获取 一个随义的id
|
||||
return $room_ids[array_rand($room_ids)];
|
||||
}
|
||||
if($task_id == 22){
|
||||
//拍卖 且有人有热度
|
||||
$room_ids = db::name('vs_room')->alias('a')->join('vs_room_visitor b','a.id = b.room_id','right')
|
||||
->where(['a.type_id' => 9,'a.room_status' => 1,'a.today_hot_value' => ['>',0],'b.user_id' => ['<>',0]])
|
||||
->column('a.id');
|
||||
if(!$room_ids){
|
||||
return 0;
|
||||
}
|
||||
//在上面获取 一个随义的id
|
||||
return $room_ids[array_rand($room_ids)];
|
||||
}
|
||||
if($task_id == 23){
|
||||
//拍卖 且有人有热度
|
||||
$room_ids = db::name('vs_room')->alias('a')->join('vs_room_visitor b','a.id = b.room_id','right')
|
||||
->where(['a.type_id' => 7,'a.room_status' => 1,'a.today_hot_value' => ['>',0],'b.user_id' => ['<>',0]])
|
||||
->column('a.id');
|
||||
if(!$room_ids){
|
||||
return 0;
|
||||
}
|
||||
//在上面获取 一个随义的id
|
||||
return $room_ids[array_rand($room_ids)];
|
||||
}
|
||||
if(in_array($task_id, [7,8,13,14,18,19,20])){
|
||||
//抽奖
|
||||
$room_ids = db::name('vs_room')->where(['room_status' => 1])->column('id');
|
||||
if(!$room_ids){
|
||||
return 0;
|
||||
}
|
||||
//在上面获取 一个随义的id
|
||||
return $room_ids[array_rand($room_ids)];
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -681,4 +681,19 @@ class Sign extends Model
|
||||
return ['code' => 1, 'msg' => '操作成功', 'data' => null];
|
||||
}
|
||||
|
||||
|
||||
//获取首次被签约且在约期内的徒弟列表
|
||||
public function get_first_sign_student_list($user_id)
|
||||
{
|
||||
$user = db::name('vs_user_sign')->field('sign_user_id as user_id')
|
||||
->where(['parent_user_id' => $user_id,'sign_user_type' => 0,'end_time' => ['>',time()]])
|
||||
->select();
|
||||
if($user){
|
||||
foreach ($user as $k => $v){
|
||||
$user[$k] = model('api/User')->get_user_base_info($v['user_id']);
|
||||
}
|
||||
}
|
||||
return ['code' => 1, 'msg' => '操作成功', 'data' => $user];
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user