Browse Source

update 共富制度

tags/v1.9.2
DengBiao 2 years ago
parent
commit
3425872af1
1 changed files with 10 additions and 2 deletions
  1. +10
    -2
      rule/public_platoon_relate_commission.go

+ 10
- 2
rule/public_platoon_relate_commission.go View File

@@ -44,11 +44,19 @@ func AddPublicPlatoonRelateCommission(engine *xorm.Engine, AddPublicPlatoonRelat
return nil, err
}
if userPublicPlatoonRelation != nil {
userPublicPlatoonRelation.Uid = zhios_order_relate_utils.StrToInt(param.Uid)
now := time.Now()
uniqueIdentifier := strings.Split(userPublicPlatoonRelation.UniqueIdentifier, "-")
uniqueIdentifier[1] = param.Uid

userPublicPlatoonRelation.Uid = zhios_order_relate_utils.StrToInt(param.Uid)
userPublicPlatoonRelation.UniqueIdentifier = strings.Join(uniqueIdentifier, "-")
updateAffected, err := db.UserPublicPlatoonRelationUpdate(engine.NewSession(), userPublicPlatoonRelation.Id, userPublicPlatoonRelation, "uid", "unique_identifier")
userPublicPlatoonRelation.RecommendUid = zhios_order_relate_utils.StrToInt(param.RecommendUid)
userPublicPlatoonRelation.ReturnCommissionNum = 0
userPublicPlatoonRelation.JoinAt = time.Now()
userPublicPlatoonRelation.WaitForSettlementDate = now.AddDate(0, 0, userPublicPlatoonSetting.SettleDay).Format("2006-01-02")
userPublicPlatoonRelation.CreateAt = now
userPublicPlatoonRelation.UpdateAt = now
updateAffected, err := db.UserPublicPlatoonRelationUpdate(engine.NewSession(), userPublicPlatoonRelation.Id, userPublicPlatoonRelation)
if err != nil {
return nil, err
}


Loading…
Cancel
Save