当前位置: 首页>>代码示例>>Golang>>正文


Golang IMember.GetAccount方法代码示例

本文整理汇总了Golang中go2o/src/core/domain/interface/member.IMember.GetAccount方法的典型用法代码示例。如果您正苦于以下问题:Golang IMember.GetAccount方法的具体用法?Golang IMember.GetAccount怎么用?Golang IMember.GetAccount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在go2o/src/core/domain/interface/member.IMember的用法示例。


在下文中一共展示了IMember.GetAccount方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。

示例1: backCashForMember

func backCashForMember(m member.IMember, order *shopping.ValueOrder, fee int, refName string) error {
	//更新账户
	acc := m.GetAccount()
	acv := acc.GetValue()
	bFee := float32(fee)
	acv.PresentBalance += bFee // 更新赠送余额
	acv.TotalPresentFee += bFee
	acv.UpdateTime = time.Now().Unix()
	_, err := acc.Save()

	if err == nil {
		//给自己返现
		icLog := &member.IncomeLog{
			MemberId:   m.GetAggregateRootId(),
			OrderId:    order.Id,
			Type:       "backcash",
			Fee:        float32(fee),
			Log:        fmt.Sprintf("推广返现¥%s元,订单号:%s,来源:%s", format.FormatFloat(bFee), order.OrderNo, refName),
			State:      1,
			RecordTime: acv.UpdateTime,
		}
		err = m.SaveIncomeLog(icLog)
	}
	return err
}
开发者ID:henrylee2cn,项目名称:go2o,代码行数:25,代码来源:cash_back.go

示例2: updateShoppingMemberBackFee

// 更新返现到会员账户
func (this *Order) updateShoppingMemberBackFee(pt partner.IPartner,
	m member.IMember, fee float32, unixTime int64) {
	if fee == 0 {
		return
	}
	v := this.GetValue()
	pv := pt.GetValue()

	//更新账户
	acc := m.GetAccount()
	//acc.TotalFee += this._value.Fee
	//acc.TotalPay += this._value.PayFee
	acc.PresentBalance += fee // 更新赠送余额
	acc.TotalPresentFee += fee
	acc.UpdateTime = unixTime
	m.SaveAccount()

	//给自己返现
	icLog := &member.IncomeLog{
		MemberId:   this._value.MemberId,
		OrderId:    v.Id,
		Type:       "backcash",
		Fee:        fee,
		Log:        fmt.Sprintf("订单:%s(商家:%s)返现¥%.2f元", v.OrderNo, pv.Name, fee),
		State:      1,
		RecordTime: unixTime,
	}
	m.SaveIncomeLog(icLog)
}
开发者ID:AlwaysOnline,项目名称:go2o,代码行数:30,代码来源:order.go

示例3: updateMemberAccount

func (this *Order) updateMemberAccount(m member.IMember,
	ptName, mName string, fee float32, unixTime int64) {
	if fee == 0 {
		return
	}

	//更新账户
	acc := m.GetAccount()
	acc.PresentBalance += fee
	acc.TotalPresentFee += fee
	acc.UpdateTime = unixTime
	m.SaveAccount()

	//给自己返现
	icLog := &member.IncomeLog{
		MemberId: this._value.MemberId,
		Type:     "backcash",
		Fee:      fee,
		Log: fmt.Sprintf("订单:%s(商家:%s,会员:%s)收入¥%.2f元",
			this._value.OrderNo, ptName, mName, fee),
		State:      1,
		RecordTime: unixTime,
	}
	m.SaveIncomeLog(icLog)
}
开发者ID:AlwaysOnline,项目名称:go2o,代码行数:25,代码来源:order.go

示例4: handleCashBackPromotion

// 处理返现促销
func (this *Order) handleCashBackPromotion(pt partner.IPartner, m member.IMember,
	v *shopping.OrderPromotionBind, pm promotion.IPromotion) error {
	cpv := pm.GetRelationValue().(*promotion.ValueCashBack)

	//更新账户
	bFee := float32(cpv.BackFee)
	acc := m.GetAccount()
	acv := acc.GetValue()
	acv.PresentBalance += bFee // 更新赠送余额
	acv.TotalPresentFee += bFee
	// 赠送金额,不应该计入到余额,可采取充值到余额
	//acc.Balance += float32(cpv.BackFee)                            // 更新账户余额

	acv.UpdateTime = time.Now().Unix()
	_, err := acc.Save()

	if err == nil {
		// 优惠绑定生效
		v.IsApply = 1
		this._shoppingRep.SavePromotionBindForOrder(v)

		// 处理自定义返现
		c := pm.(promotion.ICashBackPromotion)
		HandleCashBackDataTag(m, this._value, c, this._memberRep)

		//给自己返现
		tit := fmt.Sprintf("返现¥%d元,订单号:%s", cpv.BackFee, this._value.OrderNo)
		err = acc.PresentBalance(tit, v.OrderNo, float32(cpv.BackFee))
	}
	return err
}
开发者ID:zoe527,项目名称:go2o,代码行数:32,代码来源:order.go

示例5: handleCashBackPromotion

// 处理返现促销
func (this *Order) handleCashBackPromotion(pt partner.IPartner, m member.IMember,
	v *shopping.OrderPromotionBind, pm promotion.IPromotion) error {
	cpv := pm.GetRelationValue().(*promotion.ValueCashBack)

	//更新账户
	acc := m.GetAccount()
	acc.PresentBalance = acc.PresentBalance + float32(cpv.BackFee) // 更新赠送余额
	acc.Balance += float32(cpv.BackFee)                            // 更新账户余额
	acc.UpdateTime = time.Now().Unix()
	err := m.SaveAccount()

	if err == nil {
		// 优惠绑定生效
		v.IsApply = 1
		this._shoppingRep.SavePromotionBindForOrder(v)

		// 处理自定义返现
		c := pm.(promotion.ICashBackPromotion)
		HandleCashBackDataTag(m, this._value, c, this._memberRep)

		//给自己返现
		icLog := &member.IncomeLog{
			MemberId:   this._value.MemberId,
			OrderId:    this.GetDomainId(),
			Type:       "backcash",
			Fee:        float32(cpv.BackFee),
			Log:        fmt.Sprintf("返现¥%d元,订单号:%s", cpv.BackFee, this._value.OrderNo),
			State:      1,
			RecordTime: acc.UpdateTime,
		}
		err = m.SaveIncomeLog(icLog)
	}
	return err
}
开发者ID:sunxboy,项目名称:go2o,代码行数:35,代码来源:order.go

示例6: updateAccountForOrder

// 更新账户
func updateAccountForOrder(m member.IMember, order shopping.IOrder) {
	acc := m.GetAccount()
	ov := order.GetValue()
	acc.TotalFee += ov.Fee
	acc.TotalPay += ov.PayFee
	acc.UpdateTime = time.Now().Unix()
	m.SaveAccount()
}
开发者ID:AlwaysOnline,项目名称:go2o,代码行数:9,代码来源:order.go

示例7: backCashForMember

func backCashForMember(m member.IMember, order *shopping.ValueOrder,
	fee int, refName string) error {
	//更新账户
	acc := m.GetAccount()
	acv := acc.GetValue()
	bFee := float32(fee)
	acv.PresentBalance += bFee // 更新赠送余额
	acv.TotalPresentFee += bFee
	acv.UpdateTime = time.Now().Unix()
	_, err := acc.Save()

	if err == nil {
		tit := fmt.Sprintf("推广返现¥%s元,订单号:%s,来源:%s",
			format.FormatFloat(bFee), order.OrderNo, refName)
		err = acc.PresentBalance(tit, order.OrderNo, float32(fee))
	}
	return err
}
开发者ID:zoe527,项目名称:go2o,代码行数:18,代码来源:cash_back.go

示例8: updateMemberAccount

func (this *Order) updateMemberAccount(m member.IMember,
	ptName, mName string, fee float32, unixTime int64) {
	if fee == 0 {
		return
	}

	//更新账户
	acc := m.GetAccount()
	acv := acc.GetValue()
	acv.PresentBalance += fee
	acv.TotalPresentFee += fee
	acv.UpdateTime = unixTime
	acc.Save()

	//给自己返现
	tit := fmt.Sprintf("订单:%s(商家:%s,会员:%s)收入¥%.2f元",
		this._value.OrderNo, ptName, mName, fee)
	acc.PresentBalance(tit, this._value.OrderNo, fee)
}
开发者ID:zoe527,项目名称:go2o,代码行数:19,代码来源:order.go

示例9: 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
}
开发者ID:henrylee2cn,项目名称:go2o,代码行数:22,代码来源:member_service.go

示例10: updateShoppingMemberBackFee

// 更新返现到会员账户
func (this *Order) updateShoppingMemberBackFee(pt partner.IPartner,
	m member.IMember, fee float32, unixTime int64) {
	if fee == 0 {
		return
	}
	v := this.GetValue()
	pv := pt.GetValue()

	//更新账户
	acc := m.GetAccount()
	acv := acc.GetValue()
	//acc.TotalFee += this._value.Fee
	//acc.TotalPay += this._value.PayFee
	acv.PresentBalance += fee // 更新赠送余额
	acv.TotalPresentFee += fee
	acv.UpdateTime = unixTime
	acc.Save()

	//给自己返现
	tit := fmt.Sprintf("订单:%s(商家:%s)返现¥%.2f元", v.OrderNo, pv.Name, fee)
	acc.PresentBalance(tit, v.OrderNo, float32(fee))
}
开发者ID:zoe527,项目名称:go2o,代码行数:23,代码来源:order.go


注:本文中的go2o/src/core/domain/interface/member.IMember.GetAccount方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。