db_task.go 333 B

12345678910111213
  1. package dao
  2. import (
  3. "go-common/app/admin/ep/saga/model"
  4. pkgerr "github.com/pkg/errors"
  5. )
  6. // Tasks get all the tasks for the specified project
  7. func (d *Dao) Tasks(projID, status int) (tasks []*model.Task, err error) {
  8. err = pkgerr.WithStack(d.db.Where(&model.Task{ProjID: projID, Status: status}).Find(&tasks).Error)
  9. return
  10. }