Merge branch 'refs/heads/feat-video'

This commit is contained in:
junleea 2024-12-11 17:45:59 +08:00
commit f60328be98
1 changed files with 2 additions and 2 deletions

View File

@ -65,13 +65,13 @@ func FindVideoByID(id, auth_id int) Video {
// 根据用户id查找视频列表,返回最新30条
func FindVideoListsByAuthID(auth_id int) []Video {
var videos []Video
DB.Where("auth_id = ? and isdelete =? ", auth_id, 0).Order("created_at DESC").Limit(30).Find(&videos)
DB.Where("auth_id = ? and isdelete =? ", auth_id, 0).Order("create_time DESC").Limit(30).Find(&videos)
return videos
}
func FindVideoListByTime(auth_id int, startTime, endTime string) []Video {
var videos []Video
DB.Where("auth_id = ?", auth_id).Where("isdelete=0").Where("created_at > ? and created_at < ?", startTime, endTime).Find(&videos)
DB.Where("auth_id = ?", auth_id).Where("isdelete=0").Where("create_time > ? and create_time < ?", startTime, endTime).Find(&videos)
return videos
}