点唱后端数据操作
This commit is contained in:
@@ -21,20 +21,24 @@ class SingerSong extends adminApi
|
||||
//搜索信息有值且是纯数字
|
||||
if(isset($search) && is_numeric($search)){
|
||||
$where['ss.user_id'] = $search;
|
||||
$wheres['ss.user_id'] = $search;
|
||||
}
|
||||
if(isset($search) && !is_numeric($search)){
|
||||
$where['u.nickname'] = ['like', '%'.$search.'%'];;
|
||||
}
|
||||
if(isset($start_time) && isset($end_time)){
|
||||
$where['ss.create_time'] = ['between', [strtotime($start_time), strtotime($end_time)]];
|
||||
$wheres['ss.create_time'] = ['between', [strtotime($start_time), strtotime($end_time)]];
|
||||
}
|
||||
if(isset($status)){
|
||||
$where['ss.status'] = $status;
|
||||
$wheres['ss.status'] = $status;
|
||||
}else{
|
||||
$where['ss.status'] = 0;
|
||||
$wheres['ss.status'] = 0;
|
||||
}
|
||||
|
||||
$count = db::name('vs_singer')->where($where)->count();
|
||||
$count = db::name('vs_singer')->where($wheres)->count();
|
||||
$list = db::name('vs_singer')
|
||||
->alias('ss')
|
||||
->join('user u', 'ss.user_id=u.id', 'left')
|
||||
|
||||
Reference in New Issue
Block a user