go-common/app/admin/ep/saga/dao/db_task.go

14 lines
333 B
Go
Raw Normal View History

2019-04-22 10:49:16 +00:00
package dao
import (
"go-common/app/admin/ep/saga/model"
pkgerr "github.com/pkg/errors"
)
// Tasks get all the tasks for the specified project
func (d *Dao) Tasks(projID, status int) (tasks []*model.Task, err error) {
err = pkgerr.WithStack(d.db.Where(&model.Task{ProjID: projID, Status: status}).Find(&tasks).Error)
return
}