|
|
@@ -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 |
|
|
|
} |
|
|
|