This commit is contained in:
shoopea 2019-10-11 15:02:29 +08:00
parent 546af872f0
commit 73cc862f8b

14
job.go
View File

@ -898,7 +898,6 @@ func jobVaultStatus(j Job) {
userID64, currentUserID64 int64 userID64, currentUserID64 int64
itemID64, deposit, withdraw int64 itemID64, deposit, withdraw int64
itemList, depositList, withdrawList []int64 itemList, depositList, withdrawList []int64
idList []int64
) )
err := setJobStart(j.ID64) err := setJobStart(j.ID64)
@ -931,11 +930,16 @@ func jobVaultStatus(j Job) {
AND omv.item_type_id in (?` + strings.Repeat(",?", len(p.ItemTypeListID64)-1) + `)) x AND omv.item_type_id in (?` + strings.Repeat(",?", len(p.ItemTypeListID64)-1) + `)) x
ORDER BY x.user_id ASC;` ORDER BY x.user_id ASC;`
idList = nil args := make([]interface{}, len(p.UserListID64)+len(p.ItemTypeListID64)+1)
idList = append(idList, p.UserListID64...) args[1] = p.DepositChatID64
idList = append(idList, p.ItemTypeListID64...) for i, id := range p.UserListID64 {
args[i+1] = id
}
for i, id := range p.ItemTypeListID64 {
args[i+1+len(p.UserListID64)] = id
}
rows, err := db.Query(stmt, p.DepositChatID64, idList...) rows, err := db.Query(stmt, args...)
logOnError(err, "jobVaultStatus : Get rows") logOnError(err, "jobVaultStatus : Get rows")
if err != nil { if err != nil {