巡乐会榜单 接口开发
This commit is contained in:
@@ -327,6 +327,7 @@ class Decorate extends adminApi
|
|||||||
$type = input('type', '');
|
$type = input('type', '');
|
||||||
$where = [];
|
$where = [];
|
||||||
if($user_id!=""){
|
if($user_id!=""){
|
||||||
|
$user_id = db::name('user')->where('user_code', $user_id)->value('id');
|
||||||
$where['user_id'] = $user_id;
|
$where['user_id'] = $user_id;
|
||||||
}
|
}
|
||||||
if($did!=""){
|
if($did!=""){
|
||||||
@@ -340,7 +341,8 @@ class Decorate extends adminApi
|
|||||||
$return_list = [];
|
$return_list = [];
|
||||||
foreach ($lists as $k=>$v){
|
foreach ($lists as $k=>$v){
|
||||||
$return_list[$k]['id'] = $v['udid'];
|
$return_list[$k]['id'] = $v['udid'];
|
||||||
$return_list[$k]['user_name'] = $v['user_id']."-".db::name('user')->where(['id'=>$v['user_id']])->value('nickname');
|
$user_data = db::name('user')->where(['id'=>$v['user_id']])->find();
|
||||||
|
$return_list[$k]['user_name'] = $user_data['user_code']."-".db::name('user')->where(['id'=>$v['user_id']])->value('nickname');
|
||||||
$return_list[$k]['type'] = model('api/Decorate')->TypeArray[$v['type']];
|
$return_list[$k]['type'] = model('api/Decorate')->TypeArray[$v['type']];
|
||||||
if($v['type'] >= 6){
|
if($v['type'] >= 6){
|
||||||
$return_list[$k]['name'] = $v['special_num'];
|
$return_list[$k]['name'] = $v['special_num'];
|
||||||
|
|||||||
@@ -116,4 +116,15 @@ class BlindBoxTurntable extends BaseCom
|
|||||||
$reslut = model('BlindBoxTurntableGift')->xlh_ranking($room_id,$page,$page_size);
|
$reslut = model('BlindBoxTurntableGift')->xlh_ranking($room_id,$page,$page_size);
|
||||||
return v($reslut['code'], $reslut['msg'], $reslut['data']);
|
return v($reslut['code'], $reslut['msg'], $reslut['data']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 巡乐会榜单 (以期数显示)
|
||||||
|
*/
|
||||||
|
public function get_xlh_ranking(){
|
||||||
|
$page = input('page',1);
|
||||||
|
$page_size = input('page_size',12);
|
||||||
|
$room_id = input('room_id',0);
|
||||||
|
$reslut = model('BlindBoxTurntableGift')->xlh_ranking_list($room_id,$page,$page_size);
|
||||||
|
return v($reslut['code'], $reslut['msg'], $reslut['data']);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1182,4 +1182,40 @@ class BlindBoxTurntableGift extends Model
|
|||||||
'end_time'=>$xlh_data['end_time'] ?? 0,
|
'end_time'=>$xlh_data['end_time'] ?? 0,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 巡乐会榜单
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public function xlh_ranking_list($room_id,$page=1,$page_size=12){
|
||||||
|
$gift_bag_id = 13;
|
||||||
|
$xlh_box = db::name('vs_gift_bag')->where('id',$gift_bag_id)->find();
|
||||||
|
$xlh_ext = json_decode($xlh_box['ext'],true);
|
||||||
|
$pan_xlh = db::name('vs_room_pan_xlh')->where(['room_id'=>$room_id])->select();
|
||||||
|
$list = [];
|
||||||
|
foreach ($pan_xlh as $key=>$value){
|
||||||
|
$list[$key]['periods'] = "第".$value['periods']."期";
|
||||||
|
if(!empty($value['user_id'])){
|
||||||
|
$list[$key]['nickname'] = db::name('user')->where(['id'=>$value['user_id']])->value('nickname');
|
||||||
|
}else{
|
||||||
|
$list[$key]['nickname'] = "无";
|
||||||
|
}
|
||||||
|
if(!empty($value['locking_gift_id'])){
|
||||||
|
$gift_data = db::name('vs_gift')->field('gift_name,base_image')->where(['gid'=>$value['locking_gift_id']])->find();
|
||||||
|
$list[$key]['gift_name'] = 'x '.$value['num'].' '.$gift_data['gift_name'];
|
||||||
|
$list[$key]['base_image'] = $gift_data['base_image']??"";
|
||||||
|
}else{
|
||||||
|
$gift_data = db::name('vs_gift')->field('gift_name,base_image')->where(['gid'=>$xlh_ext['locking_condition']['locking_gift_id']])->find();
|
||||||
|
$list[$key]['gift_name'] = 'x 0 '.$gift_data['gift_name'];
|
||||||
|
$list[$key]['base_image'] = $gift_data['base_image']??"";
|
||||||
|
}
|
||||||
|
$list[$key]['createtime'] = date('Y-m-d H:i:s',$value['send_time']);
|
||||||
|
}
|
||||||
|
return [
|
||||||
|
'code' => 1,
|
||||||
|
'msg' => '成功',
|
||||||
|
'data' => $list
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user