JM-WechatMini/service/app/todes.go
2024-01-11 16:03:51 +08:00

21 lines
520 B
Go

package app
import (
"miniapp/global"
"miniapp/model/common"
"miniapp/model/common/request"
)
type TodesService struct{}
func (t TodesService) GetUserTodos(notes *request.GetUserNotes) (list []common.UserTodo, err error) {
err = global.GVA_DB.Where("user_id = ? and is_finish = ?", notes.UserId, notes.IsFinish).Find(&list).Error
return
}
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
}