@@ -1,16 +1,17 @@ | |||||
package md | package md | ||||
const ( | const ( | ||||
PVD_TB = "taobao" | |||||
PVD_JD = "jd" | |||||
PVD_SN = "suning" | |||||
PVD_VIP = "vip" | |||||
PVD_PDD = "pdd" | |||||
PVD_KL = "kaola" | |||||
PVD_TM = "tmall" | |||||
PVD_DTK = "dataoke" | |||||
PVD_HDK = "haodanku" | |||||
PVD_JTT = "jingtuitui" | |||||
PVD_TB = "taobao" | |||||
PVD_JD = "jd" | |||||
PVD_JDOwn = "jd_own" | |||||
PVD_SN = "suning" | |||||
PVD_VIP = "vip" | |||||
PVD_PDD = "pdd" | |||||
PVD_KL = "kaola" | |||||
PVD_TM = "tmall" | |||||
PVD_DTK = "dataoke" | |||||
PVD_HDK = "haodanku" | |||||
PVD_JTT = "jingtuitui" | |||||
// 特殊活动免单方案 | // 特殊活动免单方案 | ||||
PVD_FREE = "free" | PVD_FREE = "free" | ||||
PVD_MEITUAN = "meituan" | PVD_MEITUAN = "meituan" | ||||
@@ -20,12 +20,13 @@ var pvdCfgList = map[string]struct { | |||||
SK string | SK string | ||||
Sid string | Sid string | ||||
}{ | }{ | ||||
md.PVD_TB: {"third_taobao_svc_ak", "third_taobao_svc_sk", "third_taobao_web_sid"}, | |||||
md.PVD_KL: {md.KEY_CFG_KL_AK, md.KEY_CFG_KL_SK, ""}, | |||||
md.PVD_SN: {md.KEY_CFG_SN_AK, md.KEY_CFG_SN_SK, ""}, | |||||
md.PVD_JD: {md.KEY_CFG_ZM_AK, md.KEY_CFG_ZM_SK, md.KEY_CFG_ZM_WEB_ID}, | |||||
md.PVD_PDD: {md.KEY_CFG_ZM_AK, md.KEY_CFG_ZM_SK, md.KEY_CFG_ZM_WEB_ID}, | |||||
md.PVD_VIP: {md.KEY_CFG_ZM_AK, md.KEY_CFG_ZM_SK, md.KEY_CFG_ZM_WEB_ID}, | |||||
md.PVD_TB: {"third_taobao_svc_ak", "third_taobao_svc_sk", "third_taobao_web_sid"}, | |||||
md.PVD_KL: {md.KEY_CFG_KL_AK, md.KEY_CFG_KL_SK, ""}, | |||||
md.PVD_SN: {md.KEY_CFG_SN_AK, md.KEY_CFG_SN_SK, ""}, | |||||
md.PVD_JD: {md.KEY_CFG_ZM_AK, md.KEY_CFG_ZM_SK, md.KEY_CFG_ZM_WEB_ID}, | |||||
md.PVD_JDOwn: {md.KEY_CFG_ZM_AK, md.KEY_CFG_ZM_SK, md.KEY_CFG_ZM_WEB_ID}, | |||||
md.PVD_PDD: {md.KEY_CFG_ZM_AK, md.KEY_CFG_ZM_SK, md.KEY_CFG_ZM_WEB_ID}, | |||||
md.PVD_VIP: {md.KEY_CFG_ZM_AK, md.KEY_CFG_ZM_SK, md.KEY_CFG_ZM_WEB_ID}, | |||||
} | } | ||||
func GetAllPlan(eg *xorm.Engine, dbName string) (map[string]*model.PlanReward, map[int]*model.PlanCommission, map[int]string) { | func GetAllPlan(eg *xorm.Engine, dbName string) (map[string]*model.PlanReward, map[int]*model.PlanCommission, map[int]string) { | ||||
@@ -82,6 +83,9 @@ func GetPlanCfg(eg *xorm.Engine, pvd, masterId string, rewardOpts map[string]*mo | |||||
rewardOpt = rewardOpts["kuaishouTeam"] | rewardOpt = rewardOpts["kuaishouTeam"] | ||||
} | } | ||||
} | } | ||||
if pvd == md.PVD_JDOwn && rewardOpts["jd_own"] == nil { | |||||
rewardOpt = rewardOpts["jd"] | |||||
} | |||||
if rewardOpt == nil { | if rewardOpt == nil { | ||||
return nil, zhios_order_relate_logx.Warn("找不到方案记录") | return nil, zhios_order_relate_logx.Warn("找不到方案记录") | ||||
} | } | ||||
@@ -20,7 +20,7 @@ func GetRewardCommission(engine *xorm.Engine, rmd *md.CommissionParam, isShare b | |||||
virType := commArr["virType"] | virType := commArr["virType"] | ||||
if virType == "commission" { | if virType == "commission" { | ||||
rmd.PaidPrice = rmd.Commission | rmd.PaidPrice = rmd.Commission | ||||
if zhios_order_relate_utils.InArr(provider, []string{md.PVD_TB, md.PVD_TM, md.PVD_PDD, md.PVD_SN, md.PVD_KL, md.PVD_JD, md.PVD_VIP}) == false { | |||||
if zhios_order_relate_utils.InArr(provider, []string{md.PVD_TB, md.PVD_TM, md.PVD_PDD, md.PVD_SN, md.PVD_KL, md.PVD_JD, md.PVD_JDOwn, md.PVD_VIP}) == false { | |||||
rmd.GoodsPrice = rmd.Commission | rmd.GoodsPrice = rmd.Commission | ||||
} | } | ||||
} | } | ||||
@@ -78,7 +78,6 @@ func GetRewardCommission(engine *xorm.Engine, rmd *md.CommissionParam, isShare b | |||||
if cfg == nil { | if cfg == nil { | ||||
return 0, 0, 0, 0, nil, errors.New("分佣方案未设置") | return 0, 0, 0, 0, nil, errors.New("分佣方案未设置") | ||||
} | } | ||||
// 获取全部佣金 | // 获取全部佣金 | ||||
com, price := getCommission(rmd, provider) | com, price := getCommission(rmd, provider) | ||||
fmt.Println(com) | fmt.Println(com) | ||||
@@ -469,7 +468,7 @@ func getCommission(d *md.CommissionParam, provider string) (string, string) { | |||||
commissionRateF := zhios_order_relate_utils.StrToFloat64(d.CommissionRate) / 100 | commissionRateF := zhios_order_relate_utils.StrToFloat64(d.CommissionRate) / 100 | ||||
com := currentPriceF * commissionRateF | com := currentPriceF * commissionRateF | ||||
return zhios_order_relate_utils.Float64ToStr(com), currentPrice | return zhios_order_relate_utils.Float64ToStr(com), currentPrice | ||||
case md.PVD_JD: | |||||
case md.PVD_JD, md.PVD_JDOwn: | |||||
if zhios_order_relate_utils.StrToFloat64(d.GoodsPrice) == 0 { | if zhios_order_relate_utils.StrToFloat64(d.GoodsPrice) == 0 { | ||||
//如果价格没有直接返回佣金 | //如果价格没有直接返回佣金 | ||||
return d.Commission, d.PaidPrice | return d.Commission, d.PaidPrice | ||||
@@ -539,7 +538,7 @@ func currentPrice(m *md.CommissionParam, pvd string) string { | |||||
return zhios_order_relate_utils.Float64ToStr(price) | return zhios_order_relate_utils.Float64ToStr(price) | ||||
} | } | ||||
return m.WlGoodsPrice | return m.WlGoodsPrice | ||||
case md.PVD_JD: | |||||
case md.PVD_JD, md.PVD_JDOwn: | |||||
//fmt.Println(m.LowestCouponPrice, m.LowerPrice, m.WlGoodsPrice) | //fmt.Println(m.LowestCouponPrice, m.LowerPrice, m.WlGoodsPrice) | ||||
if m.LowestCouponPrice == "" { | if m.LowestCouponPrice == "" { | ||||
if m.CouponPrice != "" { | if m.CouponPrice != "" { | ||||