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 }
// 应用优惠券 func (this *Order) ApplyCoupon(coupon promotion.ICouponPromotion) error { if this._coupons == nil { this._coupons = []promotion.ICouponPromotion{} } this._coupons = append(this._coupons, coupon) v := this._value //v.CouponCode = val.Code //v.CouponDescribe = coupon.GetDescribe() v.CouponFee = coupon.GetCouponFee(v.Fee) v.PayFee = this.GetPaymentFee() v.DiscountFee = v.DiscountFee + v.CouponFee return nil }