This commit is contained in:
shoopea 2019-10-13 15:23:25 +08:00
parent f80527d048
commit e979ed30d7

12
job.go
View File

@ -949,12 +949,12 @@ func jobVaultItemStatus(j Job) {
err = rows.Scan(&itemID64, &userID64, &deposit, &withdraw)
logOnError(err, "jobVaultItemStatus : scan next val")
if itemID64 != currentItemID64 {
if currentUserID64 != 0 {
if currentItemID64 != 0 {
// display info
out := fmt.Sprintf("<code>%-32s | Depo. | Recv. | Total\n────────────────────────────┼──────┼──────┼──────\n", `User`)
for i, userId := range userList {
logOnError(err, "jobVaultItemStatus : getObjItem")
out = fmt.Sprintf("%s%-32d |%6d |%6d |%6d\n", out, userID, depositList[i], withdrawList[i], depositList[i]-withdrawList[i])
out = fmt.Sprintf("%s%-32d |%6d |%6d |%6d\n", out, userId, depositList[i], withdrawList[i], depositList[i]-withdrawList[i])
}
out = fmt.Sprintf("%s</code>", out)
@ -966,8 +966,8 @@ func jobVaultItemStatus(j Job) {
}
TGCmdQueue <- c
}
currentUserID64 = userID64
itemList = nil
currentItemID64 = itemID64
userList = nil
depositList = nil
withdrawList = nil
}
@ -976,12 +976,12 @@ func jobVaultItemStatus(j Job) {
depositList = append(depositList, deposit)
withdrawList = append(withdrawList, withdraw)
}
if currentUserID64 != 0 {
if currentItemID64 != 0 {
// display info
out := fmt.Sprintf("<code>%-32s | Depo. | Recv. | Total\n────────────────────────────┼──────┼──────┼──────\n", `User`)
for i, userId := range userList {
logOnError(err, "jobVaultItemStatus : getObjItem")
out = fmt.Sprintf("%s%-32d |%6d |%6d |%6d\n", out, userID, depositList[i], withdrawList[i], depositList[i]-withdrawList[i])
out = fmt.Sprintf("%s%-32d |%6d |%6d |%6d\n", out, userId, depositList[i], withdrawList[i], depositList[i]-withdrawList[i])
}
out = fmt.Sprintf("%s</code>", out)