JM-WechatMini/service/app/todes.go
2023-11-02 04:34:46 +08:00

20 lines
432 B
Go

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
}