点唱后端数据操作

This commit is contained in:
2025-11-13 17:44:20 +08:00
parent aeb97bb2fc
commit 720d814915

View File

@@ -19,14 +19,14 @@ class SingerSong extends adminApi
$status = input('status', ''); $status = input('status', '');
$where=[]; $where=[];
//搜索信息有值且是纯数字 //搜索信息有值且是纯数字
if(isset($search) && is_numeric($search)){ if(is_numeric($search)){
$where['ss.user_id'] = $search; $where['ss.user_id'] = $search;
$wheres['user_id'] = $search; $wheres['user_id'] = $search;
} }
if(isset($search) && !is_numeric($search)){ if($search && !is_numeric($search)){
$where['u.nickname'] = ['like', '%'.$search.'%'];; $where['u.nickname'] = ['like', '%'.$search.'%'];;
} }
if(isset($start_time) && isset($end_time)){ if($start_time && $end_time){
$where['ss.createtime'] = ['between', [strtotime($start_time), strtotime($end_time)]]; $where['ss.createtime'] = ['between', [strtotime($start_time), strtotime($end_time)]];
$wheres['createtime'] = ['between', [strtotime($start_time), strtotime($end_time)]]; $wheres['createtime'] = ['between', [strtotime($start_time), strtotime($end_time)]];
} }
@@ -82,7 +82,7 @@ class SingerSong extends adminApi
$page_limit = input('page_limit', 30); $page_limit = input('page_limit', 30);
$user_id = input('user_id', ''); $user_id = input('user_id', '');
$where=[]; $where=[];
if(isset($user_id)){ if($user_id){
$where['user_id'] = $user_id; $where['user_id'] = $user_id;
}else{ }else{
return V(0, '请填写用户ID'); return V(0, '请填写用户ID');
@@ -173,7 +173,7 @@ class SingerSong extends adminApi
$room_id = input('room_id', ''); $room_id = input('room_id', '');
$where=[]; $where=[];
if(isset($room_id)){ if($room_id){
$where['room_id'] = $room_id; $where['room_id'] = $room_id;
}else{ }else{
return V(0, '请填写房间ID'); return V(0, '请填写房间ID');