promotion

package
v0.0.0-...-1960156 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 9, 2015 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

*

  • Copyright 2015 @ z3q.net.
  • name : cash_back
  • author : jarryliu
  • date : -- :
  • description :
  • history :

*

  • Copyright 2015 @ z3q.net.
  • name : factor
  • author : jarryliu
  • date : -- :
  • description :
  • history :

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeletePromotion

func DeletePromotion(p promotion.IPromotion) error

Types

type CashBackPromotion

type CashBackPromotion struct {
	*Promotion
	// contains filtered or unexported fields
}

func (*CashBackPromotion) GetDataTag

func (this *CashBackPromotion) GetDataTag() map[string]string

获取自定义数据

func (*CashBackPromotion) GetDomainId

func (this *CashBackPromotion) GetDomainId() int

获取领域编号

func (*CashBackPromotion) GetRelationValue

func (this *CashBackPromotion) GetRelationValue() interface{}

获取相关的值

func (*CashBackPromotion) Save

func (this *CashBackPromotion) Save() (int, error)

保存

func (*CashBackPromotion) SetDetailsValue

func (this *CashBackPromotion) SetDetailsValue(v *promotion.ValueCashBack) error

设置详细的促销信息

func (*CashBackPromotion) TypeName

func (this *CashBackPromotion) TypeName() string

促销类型

type Coupon

type Coupon struct {
	*Promotion
	// contains filtered or unexported fields
}

优惠券,一张优惠券有数量,对应唯一的促销码。 优惠内容包含:送金额,送积分,订单折扣。仅在消费时有效。 使用需要达到最低金额和最低等级。 优惠券包含了开始时间和结束时间,超出时间则过期。 优惠券可以设置启用和停用 是否允许绑定,如果不绑定。则可以任意使用.只要有绑定和使用后,就不允许修改此属性。

func (*Coupon) ApplyTake

func (this *Coupon) ApplyTake(couponTakeId int) error

应用到订单

func (*Coupon) Bind

func (this *Coupon) Bind(memberId int) error

绑定

func (*Coupon) Binds

func (this *Coupon) Binds(memberIds []string) error

func (*Coupon) CanTake

func (this *Coupon) CanTake() bool

是否允许占用

func (*Coupon) CanUse

func (this *Coupon) CanUse(m member.IMember, fee float32) (bool, error)

是否可用

func (*Coupon) GetBind

func (this *Coupon) GetBind(memberId int) (*promotion.ValueCouponBind, error)

获取绑定

func (*Coupon) GetBinds

func (this *Coupon) GetBinds() []promotion.ValueCouponBind

func (*Coupon) GetCouponFee

func (this *Coupon) GetCouponFee(orderFee float32) float32

获取优惠的金额(四舍五入)

func (*Coupon) GetDescribe

func (this *Coupon) GetDescribe() string

获取优惠券描述

func (*Coupon) GetDetailsValue

func (this *Coupon) GetDetailsValue() promotion.ValueCoupon

获取促销内容

func (*Coupon) GetDomainId

func (this *Coupon) GetDomainId() int

func (*Coupon) GetRelationValue

func (this *Coupon) GetRelationValue() interface{}

获取相关的值

func (*Coupon) GetTake

func (this *Coupon) GetTake(memberId int) (*promotion.ValueCouponTake, error)

获取占用

func (*Coupon) GetTakes

func (this *Coupon) GetTakes() []promotion.ValueCouponTake

func (*Coupon) Save

func (this *Coupon) Save() (int, error)

func (*Coupon) SetDetailsValue

func (this *Coupon) SetDetailsValue(v *promotion.ValueCoupon) error

设置促销内容

func (*Coupon) Take

func (this *Coupon) Take(memberId int) error

占用

func (*Coupon) TypeName

func (this *Coupon) TypeName() string

促销类型

func (*Coupon) UseCoupon

func (this *Coupon) UseCoupon(couponBindId int) error

使用优惠券

type Promotion

type Promotion struct {
	// contains filtered or unexported fields
}

func (*Promotion) ApplyFor

func (this *Promotion) ApplyFor() int

应用类型

func (*Promotion) GetAggregateRootId

func (this *Promotion) GetAggregateRootId() int

获取聚合根编号

func (*Promotion) GetRelationValue

func (this *Promotion) GetRelationValue() interface{}

获取相关的值

func (*Promotion) GetValue

func (this *Promotion) GetValue() *promotion.ValuePromotion

获取值

func (*Promotion) Save

func (this *Promotion) Save() (int, error)

保存

func (*Promotion) SetValue

func (this *Promotion) SetValue(v *promotion.ValuePromotion) error

设置值

func (*Promotion) Type

func (this *Promotion) Type() int

促销类型

func (*Promotion) TypeName

func (this *Promotion) TypeName() string

促销类型

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL