|
@@ -201,8 +201,30 @@ class Livebc extends Api
|
|
|
}
|
|
|
|
|
|
//准备返回数据,刷礼物的总值,刷礼物人数,榜一信息
|
|
|
- public function outlivebc($party_id){
|
|
|
+ public function outlivebc(){
|
|
|
+ $party_id = Db::name('party')->where(['user_id'=>$this->auth->id,'room_type'=>2])->value('id');
|
|
|
|
|
|
+ $redis = new Redis();
|
|
|
+ $redisconfig = config("redis");
|
|
|
+ $redis->connect($redisconfig["host"], $redisconfig["port"]);
|
|
|
+
|
|
|
+ // 获取财富排行 全部
|
|
|
+ $getweek = $redis->zRevRange("livebc_jewel_to_".$party_id,0,-1,true);
|
|
|
+
|
|
|
+ $userinfo = [];
|
|
|
+ if(!empty($getweek)){
|
|
|
+ $userid = array_keys($getweek)[0];
|
|
|
+ $userinfo = Db::name('user')->field('id,username,nickname,avatar,gender')->where('id',$userid)->find();
|
|
|
+ $userinfo = info_domain_image($userinfo,['avatar']);
|
|
|
+ }
|
|
|
+
|
|
|
+ $rs = [
|
|
|
+ 'gift_value' => array_sum($getweek),
|
|
|
+ 'gift_user' => count($getweek),
|
|
|
+ 'top_userinfo' => $userinfo,
|
|
|
+ ];
|
|
|
+
|
|
|
+ $this->success('success',$rs);
|
|
|
}
|
|
|
|
|
|
|