shan
This commit is contained in:
@@ -80,7 +80,7 @@ func GetJobs(db *DaoDB, userIDs []string, categoryIDs []int, includeStep bool, f
|
||||
return pagedInfo, err
|
||||
}
|
||||
|
||||
func GetJobsNoPage(db *DaoDB, userIDs []string, categoryIDs []int, includeStep bool) (jobs []*GetJobsResult, err error) {
|
||||
func GetJobsNoPage(db *DaoDB, userIDs []string, categoryIDs []int, fromTime, toTime time.Time, includeStep bool) (jobs []*GetJobsResult, err error) {
|
||||
sql := `
|
||||
SELECT a.*, b.name
|
||||
FROM job a
|
||||
@@ -96,6 +96,14 @@ func GetJobsNoPage(db *DaoDB, userIDs []string, categoryIDs []int, includeStep b
|
||||
sql += ` AND a.job_category_id IN (` + GenQuestionMarks(len(categoryIDs)) + `)`
|
||||
sqlParams = append(sqlParams, categoryIDs)
|
||||
}
|
||||
if fromTime != utils.ZeroTimeValue {
|
||||
sql += ` AND a.created_at >= ?`
|
||||
sqlParams = append(sqlParams, fromTime)
|
||||
}
|
||||
if toTime != utils.ZeroTimeValue {
|
||||
sql += ` AND a.created_at <= ?`
|
||||
sqlParams = append(sqlParams, toTime)
|
||||
}
|
||||
err = GetRows(db, &jobs, sql, sqlParams...)
|
||||
if includeStep {
|
||||
for _, v := range jobs {
|
||||
|
||||
Reference in New Issue
Block a user