dengbiao 3 月之前
父節點
當前提交
e7281ba066
共有 2 個文件被更改,包括 52 次插入3 次删除
  1. +49
    -3
      rule/relate_commission.go
  2. +3
    -0
      svc/reward_commission.go

+ 49
- 3
rule/relate_commission.go 查看文件

@@ -147,7 +147,7 @@ func BatchGetCommissionByGoodsExtend(eg *xorm.Engine, dbName string, commissionP
return goodsId2lvUser, nil
}

//商品详情等使用
// 商品详情等使用
func SettleCommWithGoodsDetail(eg *xorm.Engine, dbName string, CommissionParam md.CommissionFirstParam) (float64, float64, float64, float64, *comm_plan.LvUser, error) {
var (
isShare = false
@@ -176,7 +176,7 @@ func SettleCommWithGoodsDetail(eg *xorm.Engine, dbName string, CommissionParam m
return profit, pvdFee, sysFee, subsidyFee, lvUser, err
}

//商品详情等使用
// 商品详情等使用
func SettleCommWithGoodsDetailExtend(eg *xorm.Engine, dbName string, CommissionParam md.CommissionFirstParam) (float64, float64, float64, float64, *comm_plan.LvUser, error) {
var (
isShare = false
@@ -205,7 +205,7 @@ func SettleCommWithGoodsDetailExtend(eg *xorm.Engine, dbName string, CommissionP
return profit, pvdFee, sysFee, subsidyFee, lvUser, err
}

//获取自购分享佣金的 商品显示
// 获取自购分享佣金的 商品显示
func GetRewardCommission(eg *xorm.Engine, dbName, mode string, CommissionParam md.CommissionFirstParam) (float64, float64, *comm_plan.LvUser, error) {
var (
isAll = false
@@ -304,6 +304,52 @@ func BatchGetCommissionByOrder(engine *xorm.Engine, dbName string, CommissionPar

return goodsId2lvUser, nil
}
func BatchGetCommissionByOrderMall(engine *xorm.Engine, dbName string, CommissionParamList []*md.CommissionFirstParam) (map[string]*comm_plan.SettleCommissionToGuide, error) {
var (
isShare = false
isAllLevelReturn = false
)
goodsId2lvUser := make(map[string]*comm_plan.SettleCommissionToGuide, len(CommissionParamList))
if len(CommissionParamList) == 0 {
return goodsId2lvUser, errors.New("参数缺失")
}
commArr := GetComm(engine)
plan, commission, virtualCoinMoneyRate := svc.GetAllPlan(engine, dbName)
for _, param := range CommissionParamList {
if param.IsShare != 0 {
isShare = true
}
if param.IsAllLevelReturn != 0 {
isAllLevelReturn = true
}

if param.Oid == "" {
return goodsId2lvUser, errors.New("订单缺失")
}
if zhios_order_relate_utils.StrToFloat64(param.CommissionParam.GoodsPrice) > 0 {
param.CommissionParam.OldPrice = param.CommissionParam.GoodsPrice
}
param.CommissionParam.ShowLevel = param.ShowLevel
param.CommissionParam.Oid = param.Oid
var mapData = map[string]string{
"old_lv": param.OldLv,
"new_lv": param.NewLv,
"ownbuy_return_type": zhios_order_relate_utils.IntToStr(param.OwnbuyReturnType),
}
profit, pvdFee, sysFee, subsidyFee, lvUser, err := svc.GetRewardCommission(engine, &param.CommissionParam, isShare, param.Uid, param.Provider, dbName, isAllLevelReturn, mapData, commArr, plan, commission, virtualCoinMoneyRate)
if err != nil {
return goodsId2lvUser, err
}
goodsId2lvUser[param.Oid] = &comm_plan.SettleCommissionToGuide{
Profit: profit,
PvdFee: pvdFee,
SysFee: sysFee,
SubsidyFee: subsidyFee,
LvUser: lvUser,
}
}
return goodsId2lvUser, nil
}
func BatchGetCommissionByOrderService(engine *xorm.Engine, dbName string, CommissionParamList []*md.CommissionFirstParam) (map[string]*comm_plan.SettleCommissionToGuide, error) {
var (
isShare = false


+ 3
- 0
svc/reward_commission.go 查看文件

@@ -776,6 +776,9 @@ func getCommission(d *md.CommissionParam, provider string) (string, string) {
return zhios_order_relate_utils.Float64ToStr(com), currentPrice
default:
if zhios_order_relate_utils.StrToFloat64(d.GoodsPrice) == 0 {
if zhios_order_relate_utils.StrToFloat64(d.PaidPrice) > 0 {
return d.Commission, d.PaidPrice
}
//如果价格没有直接返回佣金
return d.Commission, d.Commission
}


Loading…
取消
儲存