From 5f1984e327d34716946894708fab58fee884ee97 Mon Sep 17 00:00:00 2001 From: shoopea Date: Sat, 1 Feb 2020 18:52:15 +0800 Subject: [PATCH] debug vault item --- job.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/job.go b/job.go index 7e9b0fe..236a8a5 100644 --- a/job.go +++ b/job.go @@ -1179,12 +1179,16 @@ func jobVaultItemStatus(j Job) { userList, depositList, withdrawList []int64 ) + log.Printf("jobVaultItemStatus : starting\n") + err := setJobStart(j.ID64) logOnError(err, "jobVaultItemStatus : setJobStart") err = json.Unmarshal(j.Payload, &p) logOnError(err, "jobVaultItemStatus : Unmarshal payload") + log.Printf("jobVaultItemStatus : payload unmarshaled\n") + stmt := `SELECT x.item_id ,x.user_id ,(SELECT COALESCE(SUM(omv.quantity), 0) @@ -1208,6 +1212,8 @@ func jobVaultItemStatus(j Job) { AND omv.item_id in (?` + strings.Repeat(",?", len(p.ItemListID64)-1) + `)) x ORDER BY x.user_id ASC;` + log.Printf("jobVaultItemStatus : stmt\n%s\n", stmt) + args := make([]interface{}, len(p.ItemListID64)+1) args[0] = p.DepositChatID64 for i, id := range p.ItemListID64 { @@ -1271,6 +1277,14 @@ func jobVaultItemStatus(j Job) { ParseMode: cmdParseModeHTML, } TGCmdQueue <- c + } else { + c := TGCommand{ + Type: commandSendMsg, + Text: "Nothing to report", + ToChatID64: p.UserID64, + ParseMode: cmdParseModeHTML, + } + TGCmdQueue <- c } err = rows.Err()