fix:修复sql错误 (#85)

* fix:捕获协程异常

* feat:添加睡眠时间

* feat:添加睡眠管理功能

* fix:修改对标时间

* fix:修复sql错误

* feat:添加书评功能

* fix:调整格式

* fix:去掉recover

* feat:更新文档

Co-authored-by: Guohuiyuan <haibaraguo@yeahka.com>
This commit is contained in:
himawari
2021-12-08 13:12:40 +08:00
committed by GitHub
parent 9fca69302b
commit a8a3c48e6c
7 changed files with 188 additions and 18 deletions

View File

@@ -102,7 +102,7 @@ func (sdb *SleepDB) GetUp(groupId, userId int64) (position int, sleepTime time.D
sleepTime = now.Sub(st.SleepTime)
db.Debug().Model(&SleepManage{}).Where("group_id = ? and user_id = ?", groupId, userId).Update(
map[string]interface{}{
"get_up_time": now,
"sleep_time": now,
})
}
db.Debug().Model(&SleepManage{}).Where("group_id = ? and sleep_time <= ? and sleep_time >= ?", groupId, now, today).Count(&position)