本文整理汇总了Golang中go2o/core/domain/interface/member.IMember.GetRelation方法的典型用法代码示例。如果您正苦于以下问题:Golang IMember.GetRelation方法的具体用法?Golang IMember.GetRelation怎么用?Golang IMember.GetRelation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类go2o/core/domain/interface/member.IMember
的用法示例。
在下文中一共展示了IMember.GetRelation方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: backFor3R
// 三级返现
func (o *subOrderImpl) backFor3R(mch merchant.IMerchant, m member.IMember,
back_fee float32, unixTime int64) (err error) {
if back_fee > 0 {
i := 0
mName := m.Profile().GetProfile().Name
saleConf := mch.ConfManager().GetSaleConf()
percent := saleConf.CashBackTg2Percent
for i < 2 {
rl := m.GetRelation()
if rl == nil || rl.RefereesId == 0 {
break
}
m = o._memberRep.GetMember(rl.RefereesId)
if m == nil {
break
}
if i == 1 {
percent = saleConf.CashBackTg1Percent
}
err = o.updateMemberAccount(m, mch.GetValue().Name, mName,
back_fee*percent, unixTime)
if err != nil {
domain.HandleError(err, "domain")
break
}
i++
}
}
return err
}
示例2: cashBack3R
func cashBack3R(level int, m member.IMember, order *order.Order, c promotion.ICashBackPromotion, memberRep member.IMemberRep) {
dt := c.GetDataTag()
var cm member.IMember = m
var pm member.IMember = m
// fmt.Println("------ START BACK ------")
var backFunc = func(m member.IMember, parentM member.IMember, fee int) {
// fmt.Println("---------[ back ]",parentM.GetValue().Name,fee)
backCashForMember(m, order, fee, parentM.Profile().GetProfile().Name)
}
var i int = 0
for true {
rl := cm.GetRelation()
// fmt.Println("-------- BACK - ID - ",rl.InvitationMemberId)
if rl == nil || rl.RefereesId == 0 {
break
}
cm = memberRep.GetMember(rl.RefereesId)
// fmt.Println("-------- BACK ",cm == nil)
if m == nil {
break
}
if fee, err := strconv.Atoi(dt[fmt.Sprintf("G%d", i)]); err == nil {
//log.Println("[ Back][ Cash] - ",i," back ",fee)
backFunc(cm, pm, fee)
}
pm = cm
i++
if i >= level {
break
}
}
}