Browse Source

派对清理没用的redis

lizhen_gitee 1 năm trước cách đây
mục cha
commit
075005ae86
1 tập tin đã thay đổi với 23 bổ sung10 xóa
  1. 23 10
      application/api/controller/Party.php

+ 23 - 10
application/api/controller/Party.php

@@ -360,6 +360,19 @@ class Party extends Api
             $this->error('房主才能解散');
         }
 
+        //清空麦位,属性
+        //清空麦位小红心,redis
+        //清空房间人,聊天室
+        //清除两榜,redis
+        //初始化房间信息,属性
+
+        //用户魅力值
+        $this->redis->zIncrBy("hourCharm_".$party_id, $hotValue, $user_id);
+
+        //用户贡献值
+        $this->redis->zIncrBy("hourWealth_".$party_id, $hotValue, $user_id);
+
+
         // redis操作
         $user_ids = $this->redis->hGetAll("online_".$party_id);
         if(!empty($user_ids)){
@@ -507,7 +520,7 @@ class Party extends Api
     /**
      * 获取派对用户排序,(日榜,周榜,月榜) X (魅力榜,财富榜)
      */
-    public function getPartyUserRank_old() {
+    /*public function getPartyUserRank_old() {
         $room_type = input('room_type',1); // 房间类型
         $party_id = input("party_id");// 派对ID
         if (!$party_id) $this->error(__('Invalid parameters'));
@@ -551,7 +564,7 @@ class Party extends Api
         $res['toRankListMonth'] = $userModel->rankList($toweek);
 
         return $this->success("获取成功!",$res);
-    }
+    }*/
 
     //获取派对用户排序(魅力榜,财富榜),有数值的在上,0的在下
     public function getPartyUserRank() {
@@ -1935,17 +1948,17 @@ class Party extends Api
                     $i++;
                     if($party_id > 0) {
                         // 添加redis记录做魅力排行榜日榜用
-                        $this->redis->zIncrBy($this->roomTypeArr[$room_type] . "_jewel_get_" . $party_id . ":" . $day . "d", $hotValue, $user_id);
+//                        $this->redis->zIncrBy($this->roomTypeArr[$room_type] . "_jewel_get_" . $party_id . ":" . $day . "d", $hotValue, $user_id);
                         // 添加redis记录做魅力排行榜周榜用
-                        $this->redis->zIncrBy($this->roomTypeArr[$room_type] . "_jewel_get_" . $party_id . ":" . $weekday . "w", $hotValue, $user_id);
+//                        $this->redis->zIncrBy($this->roomTypeArr[$room_type] . "_jewel_get_" . $party_id . ":" . $weekday . "w", $hotValue, $user_id);
                         // 添加redis记录做魅力排行榜月榜用
-                        $this->redis->zIncrBy($this->roomTypeArr[$room_type] . "_jewel_get_" . $party_id . ":" . $monthday . "m", $hotValue, $user_id);
+//                        $this->redis->zIncrBy($this->roomTypeArr[$room_type] . "_jewel_get_" . $party_id . ":" . $monthday . "m", $hotValue, $user_id);
                         // 添加redis记录做财富排行榜日榜用
-                        $this->redis->zIncrBy($this->roomTypeArr[$room_type] . "_jewel_to_" . $party_id . ":" . $day . "d", $giftValue, $userauthid);
+//                        $this->redis->zIncrBy($this->roomTypeArr[$room_type] . "_jewel_to_" . $party_id . ":" . $day . "d", $giftValue, $userauthid);
                         // 添加redis记录做财富排行榜周榜用
-                        $this->redis->zIncrBy($this->roomTypeArr[$room_type] . "_jewel_to_" . $party_id . ":" . $weekday . "w", $giftValue, $userauthid);
+//                        $this->redis->zIncrBy($this->roomTypeArr[$room_type] . "_jewel_to_" . $party_id . ":" . $weekday . "w", $giftValue, $userauthid);
                         // 添加redis记录做财富排行榜月榜用
-                        $this->redis->zIncrBy($this->roomTypeArr[$room_type] . "_jewel_to_" . $party_id . ":" . $monthday . "m", $giftValue, $userauthid);
+//                        $this->redis->zIncrBy($this->roomTypeArr[$room_type] . "_jewel_to_" . $party_id . ":" . $monthday . "m", $giftValue, $userauthid);
 
                         // tcp 更新用户魅力值
                         $this->redis->zIncrBy("hourCharm_".$party_id, $hotValue, $user_id);
@@ -2638,7 +2651,7 @@ class Party extends Api
     /**
      * redis清理排行榜 并数据库备份
      */
-    public function updateTops() {
+    /*public function updateTops() {
         // 前一天日期
         $yestaday = date("Ymd",bcsub(time(),86400));
         // 上个周一
@@ -2676,7 +2689,7 @@ class Party extends Api
                 }
             }
         }
-    }
+    }*/
 
 
     public function handleParty() {