|
@@ -138,15 +138,15 @@ class Party extends Common
|
|
|
|
|
|
|
|
|
$matedata = [
|
|
|
- 'seat1' => json_decode([]),
|
|
|
- 'seat2' => json_decode([]),
|
|
|
- 'seat3' => json_decode([]),
|
|
|
- 'seat4' => json_decode([]),
|
|
|
- 'seat5' => json_decode([]),
|
|
|
- 'seat6' => json_decode([]),
|
|
|
- 'seat7' => json_decode([]),
|
|
|
- 'seat8' => json_decode([]),
|
|
|
- 'waitsing_list' => json_decode([]),
|
|
|
+ 'seat1' => json_encode([]),
|
|
|
+ 'seat2' => json_encode([]),
|
|
|
+ 'seat3' => json_encode([]),
|
|
|
+ 'seat4' => json_encode([]),
|
|
|
+ 'seat5' => json_encode([]),
|
|
|
+ 'seat6' => json_encode([]),
|
|
|
+ 'seat7' => json_encode([]),
|
|
|
+ 'seat8' => json_encode([]),
|
|
|
+ 'waitsing_list' => json_encode([]),
|
|
|
];
|
|
|
$rs = $easemob->room_setRoomCustomAttributeForced($easemob_room_id,$this->auth->id,$matedata);
|
|
|
|
|
@@ -350,7 +350,9 @@ class Party extends Common
|
|
|
$redis->select($redisconfig['redis_selectdb']);
|
|
|
}
|
|
|
$redisPartyRankList = $redis->zRevRange("partyRank",0,-1,true);
|
|
|
+ dump($redisPartyRankList);
|
|
|
$redisLiveRankList = $redis->zRevRange("liveRank",0,-1,true);
|
|
|
+ dump($redisLiveRankList);
|
|
|
|
|
|
$roomService = new RoomService();
|
|
|
if(!$redisPartyRankList) {
|
|
@@ -731,9 +733,16 @@ class Party extends Common
|
|
|
$heads = $redis->hGet("user_jewel_top3",$party_id);
|
|
|
$lsetList["userJewelTop3"] = $heads?json_decode($heads,true):[];
|
|
|
|
|
|
-
|
|
|
- $cellection = $redis->hGet("room_cellection",$user_id."-".$party_id);
|
|
|
- $lsetList["is_cellection"] = $cellection?1:0;
|
|
|
+
|
|
|
+
|
|
|
+ $lsetList["is_follow"] = 0;
|
|
|
+ $where = [];
|
|
|
+ $where["user_id"] = $user_id;
|
|
|
+ $where["party_id"] = $party_id;
|
|
|
+ if(Db::name('party_follow')->where($where)->find()) {
|
|
|
+ $lsetList["is_follow"] = 1;
|
|
|
+ }
|
|
|
+
|
|
|
if(isset($partyInfo["type_name"]) && $partyInfo["type_name"]) {
|
|
|
|
|
|
} else {
|
|
@@ -914,40 +923,28 @@ class Party extends Common
|
|
|
}
|
|
|
|
|
|
|
|
|
- * 派对收藏
|
|
|
+ * 派对关注
|
|
|
*/
|
|
|
- public function cellectionParty() {
|
|
|
+ public function followparty() {
|
|
|
$party_id = input('party_id',0,"intval");
|
|
|
if (!$party_id) {
|
|
|
$this->error(__('Invalid parameters'));
|
|
|
}
|
|
|
$user_id = $this->auth->id;
|
|
|
- $redis = new Redis();
|
|
|
- $redisconfig = config("redis");
|
|
|
- $redis->connect($redisconfig["host"], $redisconfig["port"]);
|
|
|
- if ($redisconfig['redis_pwd']) {
|
|
|
- $redis->auth($redisconfig['redis_pwd']);
|
|
|
- }
|
|
|
- if($redisconfig['redis_selectdb'] > 0){
|
|
|
- $redis->select($redisconfig['redis_selectdb']);
|
|
|
- }
|
|
|
|
|
|
- $partycellectionModel = new \app\common\model\PartyCellection();
|
|
|
|
|
|
$data = [];
|
|
|
$data["user_id"] = $user_id;
|
|
|
$data["party_id"] = $party_id;
|
|
|
- if($partycellectionModel->where($data)->find()) {
|
|
|
- $res = $partycellectionModel->where($data)->delete();
|
|
|
- $redis->hDel("room_cellection",$user_id."-".$party_id);
|
|
|
- return $this->success("取消收藏成功!",$res);
|
|
|
+ if(Db::name('party_follow')->where($data)->find()) {
|
|
|
+ $res = Db::name('party_follow')->where($data)->delete();
|
|
|
+
|
|
|
+ $this->success("已取消关注");
|
|
|
}
|
|
|
$data["createtime"] = time();
|
|
|
- $res = $partycellectionModel->insert($data);
|
|
|
-
|
|
|
- $redis->hSet("room_cellection",$user_id."-".$party_id,1);
|
|
|
+ $res = Db::name('party_follow')->insert($data);
|
|
|
|
|
|
- return $this->success("收藏成功!",$res);
|
|
|
+ $this->success("已关注");
|
|
|
}
|
|
|
|
|
|
|
|
@@ -959,7 +956,6 @@ class Party extends Common
|
|
|
|
|
|
$pageStart = ($page-1)*$pageNum;
|
|
|
$partycellectionModel = new \app\common\model\PartyCellection();
|
|
|
- $userModel = new \app\common\model\User();
|
|
|
$where = [];
|
|
|
$where["a.user_id"] = $this->auth->id;
|
|
|
$where["r.room_type"] = 1;
|
|
@@ -972,34 +968,7 @@ class Party extends Common
|
|
|
->select();
|
|
|
|
|
|
if($list) {
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- $redis->auth($redisconfig['redis_pwd']);
|
|
|
- }
|
|
|
- if($redisconfig['redis_selectdb'] > 0){
|
|
|
- $redis->select($redisconfig['redis_selectdb']);
|
|
|
- }*/
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
|
|
|
$users = [];
|
|
|
foreach($list as $k => $v) {
|
|
@@ -1023,7 +992,6 @@ class Party extends Common
|
|
|
}
|
|
|
$user_id = $this->auth->id;
|
|
|
$partyModel = new \app\common\model\Party();
|
|
|
- $partycellectionModel = new \app\common\model\PartyCellection();
|
|
|
$userModel = new \app\common\model\User();
|
|
|
|
|
|
$where = [];
|
|
@@ -1044,14 +1012,15 @@ class Party extends Common
|
|
|
$partyInfo["type_name"] = "普通房";
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- $partyInfo["is_sellection"] = 0;
|
|
|
+
|
|
|
+ $partyInfo["is_follow"] = 0;
|
|
|
$where = [];
|
|
|
$where["user_id"] = $user_id;
|
|
|
$where["party_id"] = $party_id;
|
|
|
- if($partycellectionModel->where($where)->find()) {
|
|
|
- $partyInfo["is_sellection"] = 1;
|
|
|
+ if(Db::name('party_follow')->where($where)->find()) {
|
|
|
+ $partyInfo["is_follow"] = 1;
|
|
|
}
|
|
|
+
|
|
|
|
|
|
$where = [];
|
|
|
$where["id"] = $partyInfo["user_id"];
|