本文整理汇总了Golang中go2o/src/core/domain/interface/member.IMember.GetValue方法的典型用法代码示例。如果您正苦于以下问题:Golang IMember.GetValue方法的具体用法?Golang IMember.GetValue怎么用?Golang IMember.GetValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类go2o/src/core/domain/interface/member.IMember
的用法示例。
在下文中一共展示了IMember.GetValue方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: CanUse
// 是否可用
func (this *Coupon) CanUse(m member.IMember, fee float32) (bool, error) {
mv := m.GetValue()
cv := this.GetValue()
if cv.AllowEnable == 0 {
return false, errors.New("无效的优惠券")
}
dtUnix := time.Now().Unix()
stUnix := cv.BeginTime
ovUnix := cv.OverTime
if dtUnix < stUnix {
return false, errors.New(fmt.Sprintf("优惠券必须在%s~%s使用",
time.Unix(cv.BeginTime, 0).Format("2006-01-02"),
time.Unix(cv.OverTime, 0).Format("2006-01-02")),
)
} else if dtUnix > ovUnix {
return false, errors.New("优惠拳已过期")
}
if cv.NeedBind == 0 && cv.Amount == 0 {
return false, errors.New("优惠券不足")
}
if mv.Level < cv.MinLevel {
return false, errors.New("会员等级不满足要求")
}
if fee < float32(cv.MinFee) {
return false, errors.New(fmt.Sprintf("订单金额需达到¥%d", cv.MinFee))
}
return true, nil
}
示例2: backFor3R
// 三级返现
func (this *Order) backFor3R(pt partner.IPartner, m member.IMember,
back_fee float32, unixTime int64) {
if back_fee == 0 {
return
}
i := 0
mName := m.GetValue().Name
saleConf := pt.GetSaleConf()
percent := saleConf.CashBackTg2Percent
for i < 2 {
rl := m.GetRelation()
if rl == nil || rl.InvitationMemberId == 0 {
break
}
m = this._memberRep.GetMember(rl.InvitationMemberId)
if m == nil {
break
}
if i == 1 {
percent = saleConf.CashBackTg1Percent
}
this.updateMemberAccount(m, pt.GetValue().Name, mName,
back_fee*percent, unixTime)
i++
}
}
示例3: GetMemberSummary
// 获取会员汇总信息
func (this *memberService) GetMemberSummary(memberId int) *dto.MemberSummary {
var m member.IMember = this._memberRep.GetMember(memberId)
if m != nil {
mv := m.GetValue()
acv := m.GetAccount().GetValue()
lv := m.GetLevel()
return &dto.MemberSummary{
Id: m.GetAggregateRootId(),
Usr: mv.Usr,
Name: mv.Name,
Exp: mv.Exp,
Level: mv.Level,
LevelName: lv.Name,
Integral: acv.Integral,
Balance: acv.Balance,
PresentBalance: acv.PresentBalance,
UpdateTime: mv.UpdateTime,
}
}
return nil
}