清除全部魅力
This commit is contained in:
@@ -1704,18 +1704,19 @@ class Room extends Model
|
||||
}
|
||||
|
||||
if($uid <= 0){
|
||||
db::name('vs_room_user_charm')->where(['room_id' => $room_id])->update(['charm' => 0,'clear_time' => time()]);
|
||||
//获取房间内所有用户
|
||||
$list = db::name('vs_room_visitor')->field('user_id')->where(['room_id' => $room_id])->select();
|
||||
|
||||
//循环清除用户魅力值
|
||||
if($list){
|
||||
foreach ($list as $v){
|
||||
//清除有魅力值的用户
|
||||
if(db::name('vs_room_user_charm')->where(['room_id' => $room_id,'user_id' => $v['user_id']])->find()){
|
||||
db::name('vs_room_user_charm')->where(['room_id' => $room_id,'user_id' => $v['user_id']])->update(['charm' => 0,'clear_time' => time()]);
|
||||
}
|
||||
}
|
||||
}
|
||||
// $list = db::name('vs_room_visitor')->field('user_id')->where(['room_id' => $room_id])->select();
|
||||
//
|
||||
// //循环清除用户魅力值
|
||||
// if($list){
|
||||
// foreach ($list as $v){
|
||||
// //清除有魅力值的用户
|
||||
// if(db::name('vs_room_user_charm')->where(['room_id' => $room_id,'user_id' => $v['user_id']])->find()){
|
||||
// db::name('vs_room_user_charm')->where(['room_id' => $room_id,'user_id' => $v['user_id']])->update(['charm' => 0,'clear_time' => time()]);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//发送消息
|
||||
$text['text'] = '清除魅力成功';
|
||||
model('Chat')->sendMsg(1021,$room_id,$text);
|
||||
|
||||
Reference in New Issue
Block a user