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


Golang promotion.ICashBackPromotion类代码示例

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


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

示例1: HandleCashBackDataTag

func HandleCashBackDataTag(m member.IMember, order *shopping.ValueOrder,
	c promotion.ICashBackPromotion, memberRep member.IMemberRep) {
	data := c.GetDataTag()
	if _, ok := data["G1"]; ok {
		cashBack3R(m, order, c, memberRep)
	}
	// fmt.Println("---------[ xxx ]",len(data),data)
}
开发者ID:henrylee2cn,项目名称:go2o,代码行数:8,代码来源:cash_back.go

示例2: HandleCashBackDataTag

func HandleCashBackDataTag(m member.IMember, order *shopping.ValueOrder,
	c promotion.ICashBackPromotion, memberRep member.IMemberRep) {
	data := c.GetDataTag()
	var level int = 0
	for k, _ := range data {
		if strings.HasPrefix(k, "G") {
			if l, err := strconv.Atoi(k[1:]); err == nil && l > level {
				level = l
			}
		}
	}
	//log.Println("[ Back][ Level] - ",level)
	cashBack3R(level, m, order, c, memberRep)
}
开发者ID:jackyan,项目名称:go2o,代码行数:14,代码来源:cash_back.go

示例3: cashBack3R

func cashBack3R(m member.IMember, order *shopping.ValueOrder, c promotion.ICashBackPromotion, memberRep member.IMemberRep) {

	var fee1 int
	var fee2 int

	dt := c.GetDataTag()
	fee1, _ = strconv.Atoi(dt["G1"])
	fee2, _ = strconv.Atoi(dt["G2"])

	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.GetValue().Name)
	}
	var i int = 0
	for true {
		rl := cm.GetRelation()
		// fmt.Println("-------- BACK - ID - ",rl.InvitationMemberId)
		if rl == nil || rl.InvitationMemberId == 0 {
			break
		}

		cm = memberRep.GetMember(rl.InvitationMemberId)

		// fmt.Println("-------- BACK ",cm == nil)
		if m == nil {
			break
		}

		if i == 0 {
			backFunc(cm, pm, fee2)
		} else if i == 1 {
			backFunc(cm, pm, fee1)
		}

		pm = cm

		i++
		if i > 1 {
			break
		}
	}
}
开发者ID:henrylee2cn,项目名称:go2o,代码行数:47,代码来源:cash_back.go

示例4: cashBack3R

func cashBack3R(level int, m member.IMember, order *shopping.ValueOrder, 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.GetValue().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
		}
	}
}
开发者ID:jackyan,项目名称:go2o,代码行数:41,代码来源:cash_back.go


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