🎨 新增查询当日提醒接口

This commit is contained in:
2024-04-26 13:23:20 +08:00
parent 8aa2b355d9
commit 39191484e5
5 changed files with 38 additions and 3 deletions

View File

@@ -4,6 +4,7 @@ import (
"miniapp/global"
"miniapp/model/common"
"miniapp/model/common/request"
"time"
)
type TodesService struct{}
@@ -18,3 +19,12 @@ func (t TodesService) UpdateTodoById(c *common.UserTodo) error {
return global.GVA_DB.Table("t_user_todo").Where("id = ?", c.ID).Update("is_finish", c.IsFinish).Error
}
// GetTodayTodos 获取今日待办
func (t TodesService) GetTodayTodos(notes *request.GetUserNotes) (list []common.UserTodo, err error) {
// 获取当前时间
nowTime := time.Now().Format("2006-01-02")
err = global.GVA_DB.Where("user_id = ? and is_finish = 0 and remind_day = ?", notes.UserId, nowTime).Find(&list).Error
return
}