refresh job

This commit is contained in:
苏尹岚
2020-10-16 15:16:26 +08:00
parent cc9ac79e45
commit 8c7806bf3d
3 changed files with 32 additions and 3 deletions

View File

@@ -88,7 +88,7 @@ func GetJobs(db *DaoDB, userIDs []string, categoryIDs, statuss, vendorIDs []int,
return pagedInfo, err
}
func GetJobsNoPage(db *DaoDB, userIDs []string, categoryIDs []int, fromTime, toTime time.Time, includeStep bool) (jobs []*GetJobsResult, err error) {
func GetJobsNoPage(db *DaoDB, userIDs []string, categoryIDs, statuss []int, fromTime, toTime time.Time, includeStep bool) (jobs []*GetJobsResult, err error) {
sql := `
SELECT a.*, b.name
FROM job a
@@ -104,6 +104,10 @@ func GetJobsNoPage(db *DaoDB, userIDs []string, categoryIDs []int, fromTime, toT
sql += ` AND a.job_category_id IN (` + GenQuestionMarks(len(categoryIDs)) + `)`
sqlParams = append(sqlParams, categoryIDs)
}
if len(statuss) > 0 {
sql += ` AND a.status IN (` + GenQuestionMarks(len(statuss)) + `)`
sqlParams = append(sqlParams, statuss)
}
if fromTime != utils.ZeroTimeValue {
sql += ` AND a.created_at >= ?`
sqlParams = append(sqlParams, fromTime)