From 5867b2286a874e48b549379c7ed4bf8b997899b5 Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Tue, 25 Jun 2024 16:20:13 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/db/model/express_order.go | 1 + consume/zhios_express_order_fail.go | 20 +++++++++++++++++--- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/app/db/model/express_order.go b/app/db/model/express_order.go index 2a4899d..73d0991 100644 --- a/app/db/model/express_order.go +++ b/app/db/model/express_order.go @@ -49,5 +49,6 @@ type ExpressOrder struct { IsAgentSupplementPay int `json:"is_agent_supplement_pay" xorm:"default 0 INT(1)"` Platform int `json:"platform" xorm:"default 0 INT(1)"` Own int `json:"own" xorm:"default 0 INT(1)"` + ExpressPlatform int `json:"express_platform" xorm:"default 0 INT(1)"` NeedDeduct string `json:"need_deduct" xorm:"default 0.00000000 DECIMAL(20,8)"` } diff --git a/consume/zhios_express_order_fail.go b/consume/zhios_express_order_fail.go index 466ec35..9928640 100644 --- a/consume/zhios_express_order_fail.go +++ b/consume/zhios_express_order_fail.go @@ -79,7 +79,8 @@ func handleZhiosExpressOrderFail(msg []byte) error { if ord.Status == "已退回" { return nil } - base := CommBase(mid) + ordExpressPlatform := utils.IntToStr(ord.ExpressPlatform) + base := CommBase(mid, ordExpressPlatform) if canalMsg.IsFail != "1" { //查下订单详情 param := map[string]interface{}{ "clientOrderNo": canalMsg.Oid, @@ -173,11 +174,24 @@ func AppUserListPuid(mid string) string { if appList != nil && appList.Puid > 0 { uid = utils.IntToStr(appList.Puid) } + + return uid +} +func AppUserListPuidNew(mid string, ordExpressPlatform string) string { + appList := offical.GetUserAppList(mid) + uid := "0" + if appList != nil && appList.Puid > 0 { + uid = utils.IntToStr(appList.Puid) + } + expressPlatform := offical.MasterListCfgGetOneData(uid, "express_platform_type") + if expressPlatform == "1" || ordExpressPlatform == "1" { //如果是1 走智莺官方 + uid = "0" + } return uid } -func CommBase(mid string) map[string]string { - puid := AppUserListPuid(mid) +func CommBase(mid, ordExpressPlatform string) map[string]string { + puid := AppUserListPuidNew(mid, ordExpressPlatform) key := puid + "_official_express_info" stringStr, err := cache.GetString(key) stringMap := make(map[string]string)