From 6aed6b5e6a29dc7451ece0ac953f5e09a9904355 Mon Sep 17 00:00:00 2001 From: shoopea Date: Wed, 27 Oct 2021 20:54:20 +0800 Subject: [PATCH] debug pillage --- job.go | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/job.go b/job.go index 636f450..c0b6a39 100644 --- a/job.go +++ b/job.go @@ -536,6 +536,30 @@ func jobPillage(j Job) { ELSE 4 END ASC LIMIT 1;`) + log.Println("jobPillage : Query\n%s", `SELECT ox.id + FROM obj ox + ,obj_msg omx + ,obj op + ,obj_msg omp + ,obj_job oj + WHERE oj.obj_id = `+strconv.FormatInt(j.ID64, 10)+` + AND omx.user_id = oj.user_id + AND omx.sender_user_id = `+strconv.Itoa(userID64ChtWrsBot)+` + AND omx.obj_id = ox.id + AND ox.obj_sub_type_id in (`+strconv.FormatInt(cacheObjSubType[`msg_pillage_go`], 10)+ + `, `+strconv.FormatInt(cacheObjSubType[`msg_pillage_timeout`], 10)+ + `, `+strconv.FormatInt(cacheObjSubType[`msg_pillage_loss`], 10)+ + `, `+strconv.FormatInt(cacheObjSubType[`msg_pillage_win`], 10)+`) + AND op.id = `+strconv.FormatInt(r.ObjID64, 10)+` + AND omp.obj_id = op.id + AND omx.date between omp.date AND ADDTIME(omp.date, '0 0:3:30.000000') + ORDER BY CASE ox.obj_sub_type_id WHEN `+strconv.FormatInt(cacheObjSubType[`msg_pillage_win`], 10)+` THEN 0 + WHEN `+strconv.FormatInt(cacheObjSubType[`msg_pillage_loss`], 10)+` THEN 1 + WHEN `+strconv.FormatInt(cacheObjSubType[`msg_pillage_timeout`], 10)+` THEN 2 + WHEN `+strconv.FormatInt(cacheObjSubType[`msg_pillage_go`], 10)+` THEN 3 + ELSE 4 END ASC + LIMIT 1;`) + if len(ids) > 1 { // issue there ? s := TGCommand{ Type: commandSendMsg,