bill job
This commit is contained in:
23
business/model/dao/dao_bill.go
Normal file
23
business/model/dao/dao_bill.go
Normal file
@@ -0,0 +1,23 @@
|
||||
package dao
|
||||
|
||||
import (
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
"git.rosy.net.cn/jx-callback/business/model"
|
||||
)
|
||||
|
||||
func GetUserBill(db *DaoDB, userID, billID string) (userBill *model.UserBill, err error) {
|
||||
sql := `
|
||||
SELECT * FROM user_bill WHERE deleted_at = ?
|
||||
`
|
||||
sqlParams := []interface{}{utils.DefaultTimeValue}
|
||||
if userID != "" {
|
||||
sql += ` AND user_id = ?`
|
||||
sqlParams = append(sqlParams, userID)
|
||||
}
|
||||
if billID != "" {
|
||||
sql += ` AND bill_id = ?`
|
||||
sqlParams = append(sqlParams, billID)
|
||||
}
|
||||
err = GetRow(db, &userBill, sql, sqlParams)
|
||||
return userBill, err
|
||||
}
|
||||
@@ -51,9 +51,9 @@ func GetJobs(db *DaoDB, userIDs []string, categoryIDs []int, includeStep bool, f
|
||||
sql += ` AND a.created_at <= ?`
|
||||
sqlParams = append(sqlParams, toTime)
|
||||
}
|
||||
sql += " LIMIT ? OFFSET ?"
|
||||
sql += " AND a.status <> ? LIMIT ? OFFSET ?"
|
||||
pageSize = jxutils.FormalizePageSize(pageSize)
|
||||
sqlParams = append(sqlParams, pageSize, offset)
|
||||
sqlParams = append(sqlParams, model.JobStatusFailed, pageSize, offset)
|
||||
Begin(db)
|
||||
defer Commit(db)
|
||||
if err = GetRows(db, &jobs, sql, sqlParams...); err == nil {
|
||||
|
||||
Reference in New Issue
Block a user