|
@@ -2282,57 +2282,8 @@ class Party extends Api
|
|
|
$this->success('success',$list);
|
|
|
}
|
|
|
|
|
|
-// /**
|
|
|
-// * 播放动效
|
|
|
-// */
|
|
|
-// public function play($party_id,$type,$value,$number) {
|
|
|
-// // 发送tcp
|
|
|
-// $tcpArr = [];
|
|
|
-// $tcpArr['type'] = "play";
|
|
|
-// $tcpArr['data'] = [
|
|
|
-// 'party_id' => $party_id,
|
|
|
-// 'type' => $type,
|
|
|
-// 'value' => $value,
|
|
|
-// 'number' => $number,
|
|
|
-// ];
|
|
|
-// $tcpJson = json_encode($tcpArr);
|
|
|
-// $client = stream_socket_client(config("tcp"));
|
|
|
-// $buffer2 = base64_encode($tcpJson)."****";
|
|
|
-// fwrite($client, $buffer2);
|
|
|
-// }
|
|
|
|
|
|
|
|
|
-
|
|
|
- /**
|
|
|
- * 更新派对信息(热度等)
|
|
|
- */
|
|
|
- private function updatePartyHot($partyInfo,$giftValue,$room_type) {
|
|
|
-// $partyInfo = \app\common\model\Party::where(['id'=>$party_id])->find();
|
|
|
- if(!$partyInfo) return $giftValue;
|
|
|
-
|
|
|
- $party_hot = $partyInfo->party_hot > 0 ? $partyInfo->party_hot:0;
|
|
|
- $party_hot_value = $party_hot + $giftValue;
|
|
|
- $party_hot_value = $party_hot_value > 0 ? $party_hot_value : 0;
|
|
|
- if($party_hot_value != $party_hot) {
|
|
|
- // 保存数据
|
|
|
- $partyInfo->party_hot = $party_hot_value;
|
|
|
- $partyInfo->save();
|
|
|
- // 更新redis 加入缓存排序
|
|
|
-
|
|
|
- $this->redis->zAdd($this->roomTypeArr[$room_type]."Rank", $partyInfo['party_hot'], $partyInfo["id"]);
|
|
|
-
|
|
|
- // 更新redis 加入缓存
|
|
|
- $redPartyInfo = $this->redis->get($this->roomTypeArr[$room_type]."_".$partyInfo["id"]);
|
|
|
- if($redPartyInfo) {
|
|
|
- $redPartyInfo = json_decode($redPartyInfo,true);
|
|
|
- $redPartyInfo["party_hot"] = $party_hot_value;
|
|
|
- $this->redis->set($this->roomTypeArr[$room_type]."_".$partyInfo["id"],json_encode($redPartyInfo));
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- return $party_hot_value;
|
|
|
- }
|
|
|
-
|
|
|
/**
|
|
|
* 用户赠送礼物后房间内用户排行,财富榜前三名
|
|
|
*/
|