|
@@ -93,6 +93,7 @@ class Party extends Common
|
|
|
$redis = new Redis();
|
|
|
$redisconfig = config("redis");
|
|
|
$redis->connect($redisconfig["host"], $redisconfig["port"]);
|
|
|
+ $redis->auth(123456);
|
|
|
|
|
|
$where = [];
|
|
|
$where["user_id"] = $user_id;
|
|
@@ -227,6 +228,7 @@ class Party extends Common
|
|
|
$redis = new Redis();
|
|
|
$redisconfig = config("redis");
|
|
|
$redis->connect($redisconfig["host"], $redisconfig["port"]);
|
|
|
+ $redis->auth(123456);
|
|
|
|
|
|
// 更新redis 加入缓存
|
|
|
$redPartyInfo = $redis->get($this->roomTypeArr[$room_type]."_".$partyInfo["id"]);
|
|
@@ -258,6 +260,7 @@ class Party extends Common
|
|
|
$redis = new Redis();
|
|
|
$redisconfig = config("redis");
|
|
|
$redis->connect($redisconfig["host"], $redisconfig["port"]);
|
|
|
+ $redis->auth(123456);
|
|
|
$redis->zRem($this->roomTypeArr[$room_type]."Rank",$party_id);
|
|
|
$redis->del($this->roomTypeArr[$room_type]."_".$party_id);
|
|
|
$this->success("删除成功!");
|
|
@@ -288,6 +291,7 @@ class Party extends Common
|
|
|
$redis = new Redis();
|
|
|
$redisconfig = config("redis");
|
|
|
$redis->connect($redisconfig["host"], $redisconfig["port"]);
|
|
|
+ $redis->auth(123456);
|
|
|
$redisPartyRankList = $redis->zRevRange($this->roomTypeArr[$room_type]."Rank",0,-1,true);
|
|
|
$partyModel = new \app\common\model\Party();
|
|
|
if(!$redisPartyRankList) {
|
|
@@ -336,6 +340,7 @@ class Party extends Common
|
|
|
$redis = new Redis();
|
|
|
$redisconfig = config("redis");
|
|
|
$redis->connect($redisconfig["host"], $redisconfig["port"]);
|
|
|
+ $redis->auth(123456);
|
|
|
|
|
|
$res = [];
|
|
|
// 获取今天
|
|
@@ -391,6 +396,7 @@ class Party extends Common
|
|
|
$redis = new Redis();
|
|
|
$redisconfig = config("redis");
|
|
|
$redis->connect($redisconfig["host"], $redisconfig["port"]);
|
|
|
+ $redis->auth(123456);
|
|
|
// 更新热度
|
|
|
$redis->zIncrBy($this->roomTypeArr[$room_type]."Rank", $party_hot, $party_id);
|
|
|
return $this->success("更新成功!");
|
|
@@ -436,7 +442,7 @@ class Party extends Common
|
|
|
|
|
|
$redis = new Redis();
|
|
|
$redisconfig = config("redis");
|
|
|
- $redis->connect($redisconfig["host"], $redisconfig["port"]);
|
|
|
+ $redis->connect($redisconfig["host"], $redisconfig["port"]);$redis->auth(123456);$redis->auth(123456);
|
|
|
$redisData = $redis->get($this->roomTypeArr[$room_type]."_".$party_id);
|
|
|
if($redisData) {
|
|
|
$partyInfo = json_decode($redisData,true);
|
|
@@ -470,7 +476,7 @@ class Party extends Common
|
|
|
}
|
|
|
$redis = new Redis();
|
|
|
$redisconfig = config("redis");
|
|
|
- $redis->connect($redisconfig["host"], $redisconfig["port"]);
|
|
|
+ $redis->connect($redisconfig["host"], $redisconfig["port"]);$redis->auth(123456);
|
|
|
|
|
|
$res = $redis->hGetAll("online_".$party_id);
|
|
|
$user_ids = [];$userList = [];
|
|
@@ -528,7 +534,7 @@ class Party extends Common
|
|
|
$user_id = $this->auth->id;
|
|
|
$redis = new Redis();
|
|
|
$redisconfig = config("redis");
|
|
|
- $redis->connect($redisconfig["host"], $redisconfig["port"]);
|
|
|
+ $redis->connect($redisconfig["host"], $redisconfig["port"]);$redis->auth(123456);
|
|
|
$redis->zAdd("party_user_".$party_id,$this->auth->u_id,$user_id);
|
|
|
|
|
|
// 判断当前用户是否存在在直播间通过切换过来的
|
|
@@ -652,7 +658,7 @@ class Party extends Common
|
|
|
}
|
|
|
$redis = new Redis();
|
|
|
$redisconfig = config("redis");
|
|
|
- $redis->connect($redisconfig["host"], $redisconfig["port"]);
|
|
|
+ $redis->connect($redisconfig["host"], $redisconfig["port"]);$redis->auth(123456);
|
|
|
|
|
|
// 判断当前用户是否被该房间设置限制 //项目:1=房管,2=禁言,3=拉黑,4=踢出
|
|
|
$lsetList = [];
|
|
@@ -683,11 +689,11 @@ class Party extends Common
|
|
|
$user_u_id = $this->auth->u_id;
|
|
|
$redis = new Redis();
|
|
|
$redisconfig = config("redis");
|
|
|
- $redis->connect($redisconfig["host"], $redisconfig["port"]);
|
|
|
+ $redis->connect($redisconfig["host"], $redisconfig["port"]);$redis->auth(123456);
|
|
|
$redis->zRem("party_user_".$party_id,$user_u_id);
|
|
|
|
|
|
// 处理online_party_id
|
|
|
- $redis->connect($redisconfig["host"], $redisconfig["port"]);
|
|
|
+ $redis->connect($redisconfig["host"], $redisconfig["port"]);$redis->auth(123456);
|
|
|
$redis->HDel("online_" . $party_id, $this->auth->id);
|
|
|
|
|
|
// 扣除在线用户在房间情况
|
|
@@ -727,7 +733,7 @@ class Party extends Common
|
|
|
|
|
|
// $redis = new Redis();
|
|
|
// $redisconfig = config("redis");
|
|
|
-// $redis->connect($redisconfig["host"], $redisconfig["port"]);
|
|
|
+// $redis->connect($redisconfig["host"], $redisconfig["port"]);$redis->auth(123456);
|
|
|
// $userids = $redis->zRange("party_user_".$party_id,0,-1,true);
|
|
|
// $useridArr = [];
|
|
|
// if($userids)foreach($userids as $k => $v) $useridArr[$v] = $k; // 因为array_slip 不能交换数字啊
|
|
@@ -753,7 +759,7 @@ class Party extends Common
|
|
|
}
|
|
|
$redis = new Redis();
|
|
|
$redisconfig = config("redis");
|
|
|
- $redis->connect($redisconfig["host"], $redisconfig["port"]);
|
|
|
+ $redis->connect($redisconfig["host"], $redisconfig["port"]);$redis->auth(123456);
|
|
|
|
|
|
$partyModel = new \app\common\model\Party();
|
|
|
$data = [];
|
|
@@ -791,7 +797,7 @@ class Party extends Common
|
|
|
$user_id = $this->auth->id;
|
|
|
$redis = new Redis();
|
|
|
$redisconfig = config("redis");
|
|
|
- $redis->connect($redisconfig["host"], $redisconfig["port"]);
|
|
|
+ $redis->connect($redisconfig["host"], $redisconfig["port"]);$redis->auth(123456);
|
|
|
|
|
|
$partycellectionModel = new \app\common\model\PartyCellection();
|
|
|
// 添加记录
|
|
@@ -835,7 +841,7 @@ class Party extends Common
|
|
|
if($list) {
|
|
|
// $redis = new Redis();
|
|
|
// $redisconfig = config("redis");
|
|
|
-// $redis->connect($redisconfig["host"], $redisconfig["port"]);
|
|
|
+// $redis->connect($redisconfig["host"], $redisconfig["port"]);$redis->auth(123456);
|
|
|
// // 获取本周第一天
|
|
|
// $weekday = $this->firstOfWeek(date("Y-m-d H:i:s"));
|
|
|
// // 获取redis 中 用户排行榜前五名
|
|
@@ -959,7 +965,7 @@ class Party extends Common
|
|
|
// 存redis 房间信息
|
|
|
$redis = new Redis();
|
|
|
$redisconfig = config("redis");
|
|
|
- $redis->connect($redisconfig["host"], $redisconfig["port"]);
|
|
|
+ $redis->connect($redisconfig["host"], $redisconfig["port"]);$redis->auth(123456);
|
|
|
$partyInfo = $redis->get($this->roomTypeArr[$room_type]."_".$party_id);
|
|
|
if($partyInfo) {
|
|
|
$partyInfo = json_decode($partyInfo,true);
|
|
@@ -1018,14 +1024,15 @@ class Party extends Common
|
|
|
$userInfo = \app\common\model\User::field("noble,avatar,nickname,gender,level")->where(["id"=>$user_id])->find();
|
|
|
if(!$userInfo) $this->error("用户信息获取失败!");
|
|
|
// 国王防踢。
|
|
|
- $noble_no = \app\common\model\NobleLevel::where(["id"=>$userInfo['noble']])->value("level_no");
|
|
|
+ /*$noble_no = \app\common\model\NobleLevel::where(["id"=>$userInfo['noble']])->value("level_no");
|
|
|
if(($item == 3 || $item == 4) && $noble_no == "p08PCcNB") {
|
|
|
$this->error("对方已开通国王贵族,踢出房间失败!");
|
|
|
- }
|
|
|
+ }*/
|
|
|
|
|
|
$redis = new Redis();
|
|
|
$redisconfig = config("redis");
|
|
|
$redis->connect($redisconfig["host"], $redisconfig["port"]);
|
|
|
+ $redis->auth(123456);
|
|
|
|
|
|
$data = [];
|
|
|
$data["user_id"] = $user_id;
|
|
@@ -1064,6 +1071,7 @@ class Party extends Common
|
|
|
$redis = new Redis();
|
|
|
$redisconfig = config("redis");
|
|
|
$redis->connect($redisconfig["host"], $redisconfig["port"]);
|
|
|
+ $redis->auth(123456);
|
|
|
|
|
|
|
|
|
$hget=$redis->hGetAll("party_manage_".$party_id);
|
|
@@ -1095,7 +1103,7 @@ class Party extends Common
|
|
|
}
|
|
|
$redis = new Redis();
|
|
|
$redisconfig = config("redis");
|
|
|
- $redis->connect($redisconfig["host"], $redisconfig["port"]);
|
|
|
+ $redis->connect($redisconfig["host"], $redisconfig["port"]);$redis->auth(123456);
|
|
|
$res = $redis->hDel("party_manage_".$party_id,$id."-".$item);
|
|
|
|
|
|
if ($item==1) {
|
|
@@ -1131,7 +1139,7 @@ class Party extends Common
|
|
|
// 存redis 房间信息
|
|
|
$redis = new Redis();
|
|
|
$redisconfig = config("redis");
|
|
|
- $redis->connect($redisconfig["host"], $redisconfig["port"]);
|
|
|
+ $redis->connect($redisconfig["host"], $redisconfig["port"]);$redis->auth(123456);
|
|
|
$partyInfo = $redis->get($this->roomTypeArr[$room_type]."_".$party_id);
|
|
|
if($partyInfo) {
|
|
|
$partyInfo = json_decode($partyInfo,true);
|
|
@@ -1163,7 +1171,7 @@ class Party extends Common
|
|
|
|
|
|
$redis = new Redis();
|
|
|
$redisconfig = config("redis");
|
|
|
- $redis->connect($redisconfig["host"], $redisconfig["port"]);
|
|
|
+ $redis->connect($redisconfig["host"], $redisconfig["port"]);$redis->auth(123456);
|
|
|
$data = unserialize($redis->hGet("party_lineup",$party_id));
|
|
|
$data[$userid]["user_id"] = $userInfo['id'];
|
|
|
$data[$userid]["avatar"] = $userInfo['avatar'];
|
|
@@ -1197,7 +1205,7 @@ class Party extends Common
|
|
|
$userid = $this->auth->id;
|
|
|
$redis = new Redis();
|
|
|
$redisconfig = config("redis");
|
|
|
- $redis->connect($redisconfig["host"], $redisconfig["port"]);
|
|
|
+ $redis->connect($redisconfig["host"], $redisconfig["port"]);$redis->auth(123456);
|
|
|
$data=unserialize($redis->hGet("party_lineup",$party_id));
|
|
|
if($data && $is_empty != 1) {
|
|
|
foreach($data as $k => $v) {
|
|
@@ -1225,7 +1233,7 @@ class Party extends Common
|
|
|
}
|
|
|
$redis = new Redis();
|
|
|
$redisconfig = config("redis");
|
|
|
- $redis->connect($redisconfig["host"], $redisconfig["port"]);
|
|
|
+ $redis->connect($redisconfig["host"], $redisconfig["port"]);$redis->auth(123456);
|
|
|
$data = $redis->hGet("party_lineup",$party_id);
|
|
|
$dataArr = unserialize($data);
|
|
|
$datas = [];
|
|
@@ -1261,7 +1269,7 @@ class Party extends Common
|
|
|
// 存redis 房间信息
|
|
|
$redis = new Redis();
|
|
|
$redisconfig = config("redis");
|
|
|
- $redis->connect($redisconfig["host"], $redisconfig["port"]);
|
|
|
+ $redis->connect($redisconfig["host"], $redisconfig["port"]);$redis->auth(123456);
|
|
|
$partyInfo = $redis->get($this->roomTypeArr[$room_type]."_".$party_id);
|
|
|
if($partyInfo) {
|
|
|
$partyInfo = json_decode($partyInfo,true);
|
|
@@ -2261,7 +2269,7 @@ class Party extends Common
|
|
|
// 更新redis 加入缓存排序
|
|
|
$redis = new Redis();
|
|
|
$redisconfig = config("redis");
|
|
|
- $redis->connect($redisconfig["host"], $redisconfig["port"]);
|
|
|
+ $redis->connect($redisconfig["host"], $redisconfig["port"]);$redis->auth(123456);
|
|
|
$redis->zAdd($this->roomTypeArr[$room_type]."Rank", $partyInfo['party_hot'], $partyInfo["id"]);
|
|
|
|
|
|
// 更新redis 加入缓存
|
|
@@ -2294,7 +2302,7 @@ class Party extends Common
|
|
|
private function getPartyUserTop($party_id,$room_type) {
|
|
|
$redis = new Redis();
|
|
|
$redisconfig = config("redis");
|
|
|
- $redis->connect($redisconfig["host"], $redisconfig["port"]);
|
|
|
+ $redis->connect($redisconfig["host"], $redisconfig["port"]);$redis->auth(123456);
|
|
|
|
|
|
// 获取本周第一天
|
|
|
$weekday = $this->firstOfWeek(date("Y-m-d H:i:s"));
|
|
@@ -2335,7 +2343,7 @@ class Party extends Common
|
|
|
private function updateUserCharm($party_id,$user_id,$giftValue) {
|
|
|
$redis = new Redis();
|
|
|
$redisconfig = config("redis");
|
|
|
- $redis->connect($redisconfig["host"], $redisconfig["port"]);
|
|
|
+ $redis->connect($redisconfig["host"], $redisconfig["port"]);$redis->auth(123456);
|
|
|
|
|
|
// 获取用户魅力值
|
|
|
$users = $redis->zRange("hourCharm_".$party_id,0,-1,true);
|
|
@@ -2366,7 +2374,7 @@ class Party extends Common
|
|
|
|
|
|
$redis = new Redis();
|
|
|
$redisconfig = config("redis");
|
|
|
- $redis->connect($redisconfig["host"], $redisconfig["port"]);
|
|
|
+ $redis->connect($redisconfig["host"], $redisconfig["port"]);$redis->auth(123456);
|
|
|
|
|
|
if ($userId) {
|
|
|
$redis->zRem("hourCharm_" . $party_id, $userId);
|
|
@@ -2403,7 +2411,7 @@ class Party extends Common
|
|
|
|
|
|
$redis = new Redis();
|
|
|
$redisconfig = config("redis");
|
|
|
- $redis->connect($redisconfig["host"], $redisconfig["port"]);
|
|
|
+ $redis->connect($redisconfig["host"], $redisconfig["port"]);$redis->auth(123456);
|
|
|
// 获取所有派对ID
|
|
|
$party_ids = \app\common\model\Party::where(["status"=>1])->column("id");
|
|
|
// 获取数据
|
|
@@ -2439,7 +2447,7 @@ class Party extends Common
|
|
|
$partyList = \app\common\model\Party::where('is_online',1)->select();
|
|
|
$redis = new Redis();
|
|
|
$redisconfig = config("redis");
|
|
|
- $redis->connect($redisconfig["host"], $redisconfig["port"]);
|
|
|
+ $redis->connect($redisconfig["host"], $redisconfig["port"]);$redis->auth(123456);
|
|
|
|
|
|
// $redis->del("online_" . 3);die;
|
|
|
// $redis->hSet("online_" . 3, 4, 4);die;
|