|
|
@@ -105,7 +105,11 @@ func benefitUid(engine *xorm.Engine, param *md.SmallPublicPlatoonRelateCommissio |
|
|
|
} else { |
|
|
|
fatherPositions := strings.Split(userPublicPlatoonRelation.FatherUid, "-") |
|
|
|
var fatherPosition string |
|
|
|
userPublicPlatoonRelation.ReturnCommissionNum++ |
|
|
|
if zhios_order_relate_utils.StrToInt(param.ReturnCommissionNum) > 0 { |
|
|
|
userPublicPlatoonRelation.ReturnCommissionNum = zhios_order_relate_utils.StrToInt(param.ReturnCommissionNum) |
|
|
|
} else { |
|
|
|
userPublicPlatoonRelation.ReturnCommissionNum++ |
|
|
|
} |
|
|
|
userPublicPlatoonSetting, err := db.UserPublicPlatoonSettingGetOneByParams(engine, map[string]interface{}{ |
|
|
|
"key": "is_open", |
|
|
|
"value": 1, |
|
|
@@ -145,14 +149,15 @@ func benefitUid(engine *xorm.Engine, param *md.SmallPublicPlatoonRelateCommissio |
|
|
|
nowBenefitUid = zhios_order_relate_utils.AnyToString(nowBenefitUsers.Uid) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
//TODO::更新 公排关系记录 中 `return_commission_num` |
|
|
|
affected, err := db.UserSmallPublicPlatoonRelationUpdate(engine.NewSession(), userPublicPlatoonRelation.Id, userPublicPlatoonRelation, "return_commission_num") |
|
|
|
if err != nil { |
|
|
|
return nowBenefitUid, nil, err |
|
|
|
} |
|
|
|
if affected == 0 { |
|
|
|
return nowBenefitUid, nil, errors.New("更新公排关系记录失败") |
|
|
|
if zhios_order_relate_utils.StrToInt(param.ReturnCommissionNum) == 0 { |
|
|
|
//TODO::更新 公排关系记录 中 `return_commission_num` |
|
|
|
affected, err := db.UserSmallPublicPlatoonRelationUpdate(engine.NewSession(), userPublicPlatoonRelation.Id, userPublicPlatoonRelation, "return_commission_num") |
|
|
|
if err != nil { |
|
|
|
return nowBenefitUid, nil, err |
|
|
|
} |
|
|
|
if affected == 0 { |
|
|
|
return nowBenefitUid, nil, errors.New("更新公排关系记录失败") |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return nowBenefitUid, nil, nil |
|
|
|