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


Golang IMember.GetAggregateRootId方法代码示例

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


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

示例3: SettlePersist

// 结算数据持久化
func (this *Cart) SettlePersist(shopId, paymentOpt, deliverOpt, deliverId int) error {
	var shop partner.IShop
	var deliver member.IDeliver
	var err error

	if shopId > 0 {
		var pt partner.IPartner
		pt, err = this._partnerRep.GetPartner(this._partnerId)
		if err != nil {
			return err
		}
		shop = pt.GetShop(shopId)
		if shop == nil {
			return partner.ErrNoSuchShop
		}
		this._shop = shop
		this._value.ShopId = shopId
	}

	if this._value.BuyerId > 0 && deliverId > 0 {
		var m member.IMember
		m, err = this._memberRep.GetMember(this._value.BuyerId)
		if err != nil {
			return err
		}
		deliver = m.GetDeliver(deliverId)
		fmt.Println("-----", m.GetAggregateRootId(), deliverId)
		if deliver == nil {
			return member.ErrInvalidSession
		}
		this._deliver = deliver
		this._value.DeliverId = deliverId
	}

	this._value.PaymentOpt = paymentOpt
	this._value.DeliverOpt = deliverOpt
	return nil
}
开发者ID:sunxboy,项目名称:go2o,代码行数:39,代码来源:cart.go


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