|
@@ -23,6 +23,39 @@ class Plantask extends Controller
|
|
|
Db::name('gift_baobi_log')->where($map)->delete();
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ public function auto_party_clear(){
|
|
|
+
|
|
|
+
|
|
|
+ $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']);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ $partyInfo_arr = Db::name('party')->where('status',1)->column('id,user_id,easemob_room_id');
|
|
|
+
|
|
|
+ foreach($partyInfo_arr as $party_id => $partyInfo){
|
|
|
+
|
|
|
+
|
|
|
+ $redis->zRemRangeByRank("hourCharm_".$party_id, 0,-1);
|
|
|
+
|
|
|
+
|
|
|
+ $redis->zRemRangeByRank("hourWealth_".$party_id, 0,-1);
|
|
|
+
|
|
|
+
|
|
|
+ $redis->hSet("user_jewel_top3",$party_id,json_encode([]));
|
|
|
+
|
|
|
+
|
|
|
+ $this->clearSeatCharm($partyInfo['easemob_room_id'],$partyInfo,$redis);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
@@ -128,6 +161,43 @@ class Plantask extends Controller
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ * 更新到麦位小红心为0,其他不变
|
|
|
+ */
|
|
|
+ private function clearSeatCharm($easemob_room_id,$party_info,$redis) {
|
|
|
+
|
|
|
+
|
|
|
+ $easemob = new Easemob();
|
|
|
+ $seatlist = $easemob->room_getRoomCustomAttribute($easemob_room_id,['seat0','seat1','seat2','seat3','seat4','seat5','seat6','seat7']);
|
|
|
+
|
|
|
+ if(empty($seatlist)){
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ $matedata = [];
|
|
|
+
|
|
|
+
|
|
|
+ foreach($seatlist as $seatnum => $seatdata){
|
|
|
+ $seatdata = json_decode($seatdata,true);
|
|
|
+
|
|
|
+ $seatdata['charm'] = 0;
|
|
|
+
|
|
|
+ $seatdata = json_encode($seatdata);
|
|
|
+
|
|
|
+ $matedata[$seatnum] = $seatdata;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ $avatarArr = $redis->hGet("user_jewel_top3",$party_info['id']);
|
|
|
+ $matedata['wealth_top3_userlist'] = $avatarArr;
|
|
|
+ $easemob->room_setRoomCustomAttributeForced($easemob_room_id,$party_info['user_id'],$matedata);
|
|
|
+
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
|
|
|
}
|