This commit is contained in:
苏尹岚
2020-10-14 11:57:12 +08:00
parent 5f791290ca
commit accb629e14
200 changed files with 206 additions and 51995 deletions

View File

@@ -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 {