-
Notifications
You must be signed in to change notification settings - Fork 0
/
order_coupon.go
36 lines (32 loc) · 851 Bytes
/
order_coupon.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/**
* Copyright 2014 @ S1N1 Team.
* name :
* author : jarryliu
* date : 2013-12-10 10:46
* description :
* history :
*/
package shopping
import (
"go2o/src/core/domain/interface/promotion"
)
// 应用到订单的优惠券
type OrderCoupon struct {
OrderId int `db:"order_id"`
CouponId int `db:"coupon_id"`
CouponCode string `db:"coupon_code"`
Fee float32 `db:"coupon_fee"`
Describe string `db:"coupon_describe"`
SendIntegral int `db:"send_integral"`
}
func (this *OrderCoupon) Clone(coupon promotion.ICouponPromotion,
orderId int, orderFee float32) *OrderCoupon {
v := coupon.GetDetailsValue()
this.CouponCode = v.Code
this.CouponId = v.Id
this.OrderId = orderId
this.Fee = coupon.GetCouponFee(orderFee)
this.Describe = coupon.GetDescribe()
this.SendIntegral = v.Integral
return this
}