JM-WechatMini/service/app/todes.go

20 lines
432 B
Go
Raw Normal View History

2023-11-02 04:34:46 +08:00
package app
import (
"miniapp/global"
"miniapp/model/common"
)
type TodesService struct{}
func (t TodesService) GetUserTodos(userId uint) (list []common.UserTodo, err error) {
err = global.GVA_DB.Where("user_id = ?", userId).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
}