promotion

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2023 License: GPL-2.0 Imports: 11 Imported by: 0

Documentation

Overview

*

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

*

  • Copyright 2015 @ 56x.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 {
	// contains filtered or unexported fields
}

func (CashBackPromotion) ApplyFor

func (p CashBackPromotion) ApplyFor() int

应用类型

func (CashBackPromotion) GetAggregateRootId

func (p CashBackPromotion) GetAggregateRootId() int32

获取聚合根编号

func (*CashBackPromotion) GetDataTag

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

获取自定义数据

func (*CashBackPromotion) GetDomainId

func (c *CashBackPromotion) GetDomainId() int32

获取领域编号

func (*CashBackPromotion) GetRelationValue

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

获取相关的值

func (CashBackPromotion) GetValue

func (p CashBackPromotion) GetValue() *promotion.PromotionInfo

获取值

func (*CashBackPromotion) Save

func (c *CashBackPromotion) Save() (int32, error)

保存

func (*CashBackPromotion) SetDetailsValue

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

设置详细的促销信息

func (CashBackPromotion) SetValue

func (p CashBackPromotion) SetValue(v *promotion.PromotionInfo) error

设置值

func (CashBackPromotion) Type

func (p CashBackPromotion) Type() int

促销类型

func (*CashBackPromotion) TypeName

func (c *CashBackPromotion) TypeName() string

促销类型

type Coupon

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

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

func (Coupon) ApplyFor

func (p Coupon) ApplyFor() int

应用类型

func (*Coupon) ApplyTake

func (c *Coupon) ApplyTake(couponTakeId int32) error

应用到订单

func (*Coupon) Bind

func (c *Coupon) Bind(memberId int64) error

绑定

func (*Coupon) Binds

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

func (*Coupon) CanTake

func (c *Coupon) CanTake() bool

是否允许占用

func (*Coupon) CanUse

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

是否可用

func (Coupon) GetAggregateRootId

func (p Coupon) GetAggregateRootId() int32

获取聚合根编号

func (*Coupon) GetBind

func (c *Coupon) GetBind(memberId int64) (*promotion.ValueCouponBind, error)

获取绑定

func (*Coupon) GetBinds

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

func (*Coupon) GetCouponFee

func (c *Coupon) GetCouponFee(orderFee int) int

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

func (*Coupon) GetDescribe

func (c *Coupon) GetDescribe() string

获取优惠券描述

func (*Coupon) GetDetailsValue

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

获取促销内容

func (*Coupon) GetDomainId

func (c *Coupon) GetDomainId() int32

func (*Coupon) GetRelationValue

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

获取相关的值

func (*Coupon) GetTake

func (c *Coupon) GetTake(memberId int64) (*promotion.ValueCouponTake, error)

获取占用

func (*Coupon) GetTakes

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

func (Coupon) GetValue

func (p Coupon) GetValue() *promotion.PromotionInfo

获取值

func (*Coupon) Save

func (c *Coupon) Save() (int32, error)

func (*Coupon) SetDetailsValue

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

设置促销内容

func (Coupon) SetValue

func (p Coupon) SetValue(v *promotion.PromotionInfo) error

设置值

func (*Coupon) Take

func (c *Coupon) Take(memberId int64) error

占用

func (Coupon) Type

func (p Coupon) Type() int

促销类型

func (*Coupon) TypeName

func (c *Coupon) TypeName() string

促销类型

func (*Coupon) UseCoupon

func (c *Coupon) UseCoupon(couponBindId int32) error

使用优惠券

Jump to

Keyboard shortcuts

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