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)