|
@@ -156,9 +156,11 @@ class Livebc extends Api
|
|
|
$redisconfig = config("redis");
|
|
|
$redis->connect($redisconfig["host"], $redisconfig["port"], 86400 * 31);
|
|
|
|
|
|
- // 添加redis记录做财富排行榜日榜用,用直播用户的uid作为房间号
|
|
|
- $redis->zIncrBy("livebc_jewel_to_" . $partyid, $giftinfo['value'], $this->auth->id);
|
|
|
+ // 添加redis记录做财富排行榜
|
|
|
+ $redis->zIncrBy("livebc_jewel_get_" . $partyid, $giftinfo['value'], $user_id);
|
|
|
|
|
|
+ // 添加redis记录做贡献排行榜
|
|
|
+ $redis->zIncrBy("livebc_jewel_to_" . $partyid, $giftinfo['value'], $this->auth->id);
|
|
|
}
|
|
|
|
|
|
// tcp 获取房间用户周前三名
|
|
@@ -199,4 +201,29 @@ class Livebc extends Api
|
|
|
}
|
|
|
|
|
|
|
|
|
+ //准备返回数据,刷礼物的总值,刷礼物人数,榜一信息
|
|
|
+ public function outlivebc(){
|
|
|
+ $party_id = input('party_id');
|
|
|
+ if(empty($party_id)){
|
|
|
+ $this->error();
|
|
|
+ }
|
|
|
+
|
|
|
+ $redis = new Redis();
|
|
|
+ $redisconfig = config("redis");
|
|
|
+ $redis->connect($redisconfig["host"], $redisconfig["port"]);
|
|
|
+
|
|
|
+ $userModel = new \app\common\model\User();
|
|
|
+ // 获取条数
|
|
|
+ $num = 3;
|
|
|
+ // 获取3条财富排行周记录
|
|
|
+ $getweek = $redis->zRevRange("livebc_jewel_to_".$party_id,0,$num-1,true);
|
|
|
+ $userList = $userModel->rankList($getweek);
|
|
|
+
|
|
|
+ //主播共获得礼物值
|
|
|
+ //$valuesum = $redis->get('livebc_jewel_get_'.$party_id,$this->auth->id);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}
|