首页新搜索
This commit is contained in:
@@ -100,4 +100,57 @@ class Search extends BaseCom
|
||||
|
||||
return V(1, '获取成功', $lists);
|
||||
}
|
||||
|
||||
|
||||
//搜索
|
||||
public function search_list()
|
||||
{
|
||||
$search = input('search', '');
|
||||
|
||||
if(is_numeric($search)){
|
||||
$where = [
|
||||
'user_code' => $search,
|
||||
'status' => 1
|
||||
];
|
||||
$where1 = [
|
||||
'room_number' => $search,
|
||||
'apply_status' => 2,
|
||||
'type_id' => ['<>',6],
|
||||
'room_status' => 1
|
||||
];
|
||||
}else{
|
||||
$where = [
|
||||
'nickname' => ['like', '%'.$search . '%'],
|
||||
'status' => 1
|
||||
];
|
||||
$where1 = [
|
||||
'room_name' => ['like', '%'.$search . '%'],
|
||||
'apply_status' => 2,
|
||||
'type_id' => ['<>',6],
|
||||
'room_status' => 1
|
||||
];
|
||||
}
|
||||
$users = db::name('user')->field('id as user_id,nickname,avatar,user_code,sex')->where($where)->select();
|
||||
if(isset($users)){
|
||||
foreach ($users as $v){
|
||||
$v['room_id'] = 0;
|
||||
//是否在房间
|
||||
$is_room = db::name('vs_room_visitor')->where(['user_id' => $v['user_id'], 'is_delete' => 1])->order('id desc')->value('room_id');
|
||||
if ($is_room) {
|
||||
$v['room_id'] = $is_room;
|
||||
}
|
||||
$v['icon'][0] = model('UserData')->user_wealth_icon($v['id']);//财富图标
|
||||
$v['icon'][1] = model('UserData')->user_charm_icon($v['id']);//魅力图标
|
||||
}
|
||||
}
|
||||
|
||||
$rooms = db::name('vs_room')->field('id as room_id,room_name,room_cover,room_number,label_id,today_hot_value')->where($where1)->select();
|
||||
if(isset($rooms)){
|
||||
foreach ($rooms as &$v){
|
||||
$v['label_icon'] = db::name('vs_room_label')->where('id', $v['label_id'])->value('label_icon');
|
||||
$v['hot_value'] = $v['today_hot_value'];
|
||||
}
|
||||
}
|
||||
return V(1, '获取成功', ['users' => $users, 'rooms' => $rooms]);
|
||||
}
|
||||
}
|
||||
@@ -55,7 +55,7 @@ class TenSeconds
|
||||
//清理切后台超过5分钟的用户
|
||||
protected function clear_offline_user()
|
||||
{
|
||||
$time = time() - 60;
|
||||
$time = time() - 300;
|
||||
$user_list = db::name('vs_user_in_room_bg')->where('updatetime', '<=', $time)->select();
|
||||
if($user_list){
|
||||
foreach ($user_list as $v){
|
||||
|
||||
Reference in New Issue
Block a user