From 9339edac8f35c88bf96d4c5071ddc69ec11eda4a Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Mon, 6 Jan 2025 10:21:32 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=B7=E5=A8=81=E7=AC=AC=E4=B8=89=E6=96=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- thirdParty/haiwei/api.go | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/thirdParty/haiwei/api.go b/thirdParty/haiwei/api.go index 80aa1c5..5e78115 100644 --- a/thirdParty/haiwei/api.go +++ b/thirdParty/haiwei/api.go @@ -90,13 +90,13 @@ func HwSend(url string, param map[string]string, secret string) string { return url } -func HwSendOrder(eg *xorm.Engine, hwShareCode, hwSecret, method string, p string) int { +func HwSendOrder(eg *xorm.Engine, hwShareCode, hwSecret, method string, p, timeType string, prd bool) int { endTime := time.Now().Unix() startTime := endTime - 86400 param := map[string]string{ "start_time": time.Unix(startTime, 0).Format("2006-01-02 15:04:05"), "end_time": time.Unix(endTime, 0).Format("2006-01-02 15:04:05"), - "time_type": "1", + "time_type": timeType, "page_number": p, "page_size": "50", } @@ -172,26 +172,29 @@ func HwSendOrder(eg *xorm.Engine, hwShareCode, hwSecret, method string, p string json.Unmarshal([]byte(order), &list) count = len(list) for _, v := range list { - AddOrder(eg, method, v) + AddOrder(eg, method, v, prd) } } if taskList != "" && taskList != "[]" { var list = make([]map[string]interface{}, 0) json.Unmarshal([]byte(taskList), &list) for _, v := range list { - AddOrder(eg, method, v) + AddOrder(eg, method, v, prd) } } return count } -func AddOrder(eg *xorm.Engine, method string, order map[string]interface{}) { +func AddOrder(eg *xorm.Engine, method string, order map[string]interface{}, prd bool) { statusArr := map[string]string{"FINISHED": "订单成功", "GENERATE_SUCCESS": "订单成功", "WAIT_GENERATE": "订单付款", "WAIT_PAY": "创建订单", "CLOSED": "订单失效", "CANCELED": "订单失效", "FAIL": "订单失效", "CLOSE": "订单失效", "RETURNED": "订单失效", "UNPAID": "创建订单", "PAYED": "订单付款", "DEALING": "订单付款", "SENDING": "订单付款", "ORDER_RECEIVED": "订单付款", "RECEIVED": "订单成功", "RECEIVED_ORDER": "订单付款", "WAITING_RECEIVED": "订单付款", "WAIT_OUT_MEAL": "订单付款", "MAKING": "订单付款", "ARRIVED": "订单成功", "COMPLETE": "订单成功", "REFUNDED": "订单退款", "OUT_MEAL": "订单成功"} userId := order["extra"] if strings.Contains(utils.AnyToString(userId), "ddstar") == false { return } - if strings.Contains(utils.AnyToString(userId), "dev") { + if strings.Contains(utils.AnyToString(userId), "dev") && prd { + return + } + if strings.Contains(utils.AnyToString(userId), "prd") && prd == false { return }