房间内点歌 总数
This commit is contained in:
@@ -133,6 +133,18 @@ class SingerSong extends BaseCom
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//点歌各类型各个总数
|
||||||
|
public function singerSongCount()
|
||||||
|
{
|
||||||
|
$room_id = input('room_id', 0);
|
||||||
|
if (!$room_id) {
|
||||||
|
return V(0, '请选择房间');
|
||||||
|
}
|
||||||
|
$reslut = model('SingerSong')->singerSongCount($room_id);
|
||||||
|
return V($reslut['code'], $reslut['msg'], $reslut['data']);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//歌曲置顶
|
//歌曲置顶
|
||||||
public function singerSongTop()
|
public function singerSongTop()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -231,6 +231,27 @@ class SingerSong extends Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 点歌各类型各个总数
|
||||||
|
* @param type 类型 1:已点列表,2:今日列表,3:昨日列表,4:本周列表,5:本月列表
|
||||||
|
* @param room_id 房间id
|
||||||
|
*/
|
||||||
|
public function singerSongCount($room_id)
|
||||||
|
{
|
||||||
|
$where = [
|
||||||
|
'room_id' => $room_id
|
||||||
|
];
|
||||||
|
$res = [
|
||||||
|
'total' => db::name('vs_song_log')->where($where)->count(),
|
||||||
|
'today' => db::name('vs_song_log')->where($where)->where('createtime', 'between time', [strtotime(date('Y-m-d')), time()])->count(),
|
||||||
|
'yesterday' => db::name('vs_song_log')->where($where)->where('createtime', 'between time', [strtotime(date('Y-m-d', strtotime("-1 day"))), strtotime(date('Y-m-d'))])->count(),
|
||||||
|
'week' => db::name('vs_song_log')->where($where)->where('createtime', 'between time', [strtotime(date('Y-m-d', strtotime("-1 week"))), time()])->count(),
|
||||||
|
'month' => db::name('vs_song_log')->where($where)->where('createtime', 'between time', [strtotime(date('Y-m-01')), strtotime(date('Y-m-t'))])->count()
|
||||||
|
];
|
||||||
|
return $res;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 歌手等级收礼升级
|
* 歌手等级收礼升级
|
||||||
* @param user_id 用户id
|
* @param user_id 用户id
|
||||||
|
|||||||
Reference in New Issue
Block a user