|
@@ -2473,10 +2473,20 @@ class Party extends Api
|
|
|
//下麦
|
|
|
public function seat_down(){
|
|
|
$party_id = input("party_id");// 派对ID
|
|
|
- $seat_num = input('seat_num',0);//麦位数字0-7
|
|
|
+ $userId = input("user_id", 0);// 用户ID
|
|
|
|
|
|
+ /*$seat_num = input('seat_num',0);//麦位数字0-7
|
|
|
$key = "party_seat_".$party_id;
|
|
|
- $this->redis->HDel($key, $seat_num);
|
|
|
+ $this->redis->HDel($key, $seat_num);*/
|
|
|
+
|
|
|
+ //轮询下麦
|
|
|
+ $key = "party_seat_".$party_id;
|
|
|
+ $seats = $this->redis->hGetAll($key);
|
|
|
+ foreach($seats as $seat_num => $seatuserid){
|
|
|
+ if($seatuserid == $userId){
|
|
|
+ $this->redis->HDel($key, $seat_num);
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
$this->success(1);
|
|
|
}
|