|
@@ -1964,8 +1964,11 @@ class Party extends Api
|
|
|
$this->redis->zIncrBy($this->roomTypeArr[$room_type] . "_jewel_to_" . $party_id . ":" . $monthday . "m", $giftValue, $userauthid);
|
|
|
|
|
|
// tcp 更新用户魅力值
|
|
|
- $this->updateUserCharm($party_id, $user_id, $hotValue);
|
|
|
- $this->updateUserWealth($party_id, $user_id, $hotValue);
|
|
|
+ $this->redis->zIncrBy("hourCharm_".$party_id, $hotValue, $user_id);
|
|
|
+
|
|
|
+ // tcp 更新用户贡献值
|
|
|
+ $this->redis->zIncrBy("hourWealth_".$party_id, $hotValue, $user_id);
|
|
|
+
|
|
|
|
|
|
//更新麦位魅力值
|
|
|
//$this->updateSeatCharm($partyInfo['easemob_room_id'],$seat_id_arr[$user_id_key],$hotValue,$partyInfo);
|
|
@@ -2312,61 +2315,6 @@ class Party extends Api
|
|
|
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 用户赠送礼物后房间内用户魅力值增加
|
|
|
- */
|
|
|
- private function updateUserCharm($party_id,$user_id,$giftValue) {
|
|
|
-
|
|
|
-
|
|
|
- // 获取用户魅力值
|
|
|
- $users = $this->redis->zRevRange("hourCharm_".$party_id,0,-1,true);
|
|
|
-
|
|
|
- if(!$users) $users[$user_id] = 0;
|
|
|
-
|
|
|
- if(isset($users[$user_id])) {
|
|
|
- $value = $users[$user_id] + $giftValue;
|
|
|
- } else {
|
|
|
- $value = $giftValue;
|
|
|
- }
|
|
|
- $this->redis->zAdd("hourCharm_".$party_id,$value,$user_id);
|
|
|
-
|
|
|
- return true;
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- public function testredis(){
|
|
|
- $party_id = 1;
|
|
|
- $users = $this->redis->zRevRange("hourCharm_".$party_id,0,-1,true);
|
|
|
- dump($users);
|
|
|
- $users = $this->redis->zRange("hourCharm_".$party_id,0,-1,true);
|
|
|
- dump($users);
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 用户赠送礼物后房间内用户贡献值增加
|
|
|
- */
|
|
|
- private function updateUserWealth($party_id,$user_id,$giftValue) {
|
|
|
-
|
|
|
-
|
|
|
- // 获取用户魅力值
|
|
|
- $users = $this->redis->zRevRange("hourWealth_".$party_id,0,-1,true);
|
|
|
-
|
|
|
- if(!$users) $users[$user_id] = 0;
|
|
|
-
|
|
|
- if(isset($users[$user_id])) {
|
|
|
- $value = $users[$user_id] + $giftValue;
|
|
|
- } else {
|
|
|
- $value = $giftValue;
|
|
|
- }
|
|
|
- $this->redis->zAdd("hourWealth_".$party_id,$value,$user_id);
|
|
|
-
|
|
|
- return true;
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
|
|
|
|
|
|
|