This commit is contained in:
苏尹岚
2021-01-11 14:48:31 +08:00
parent 431cde11bd
commit 7ce41f81d3
5 changed files with 59 additions and 28 deletions

View File

@@ -1,6 +1,8 @@
package model
import "time"
import (
"time"
)
const (
OrderDeliveryTypePlatform = "platform" // 平台负责配送
@@ -429,15 +431,15 @@ func (v *PriceDefendOrder) TableIndex() [][]string {
type Coupons struct {
ModelIDCUL
CouponType int `json:"couponType"` //优惠券类型 1为总额满减 2为运费优惠
Name string `json:"name"` //优惠券名字
Desc string `json:"desc"` //优惠券详情描述
BeginAt time.Time `json:"beginAt"` //开始时间
EndAt time.Time `json:"endAt"` //到期时间
UpperLimit int `json:"upperLimit"` //满多少
Cut int `json:"cut"` //减多少
StoreLimit string `orm:"type(text)" json:"storeLimit"` //门店限制如100118,102919
CouponStatus int `json:"couponStatus"` //优惠券状态0为正常可使用-1为已过期 -2为还没开始
CouponType int `json:"couponType"` //优惠券类型 1为总额满减 2为运费优惠
Name string `json:"name"` //优惠券名字
Desc string `json:"desc"` //优惠券详情描述
BeginAt time.Time `json:"beginAt"` //开始时间
EndAt time.Time `json:"endAt"` //到期时间
UpperLimit int `json:"upperLimit"` //满多少
Cut int `json:"cut"` //减多少
CouponStatus int `json:"couponStatus"` //优惠券状态0为正常可使用-1为已过期 -2为还没开始
IsAll int `json:"isAll"` //是否全国有效1是
}
func (v *Coupons) TableIndex() [][]string {
@@ -461,6 +463,19 @@ func (v *UserCoupons) TableIndex() [][]string {
}
}
type StoreCoupons struct {
ModelIDCULD
CouponID int `orm:"column(coupon_id)" json:"couponID"` //优惠券ID
StoreID string `orm:"column(store_id)" json:"storeID"` //storeID
}
func (v *StoreCoupons) TableIndex() [][]string {
return [][]string{
[]string{"CouponID", "StoreID"},
}
}
// 判断是否是购买平台自有物流
// 对于京东,饿百来说,就是其自有的物流,对于微商城来说,是达达
func IsWaybillPlatformOwn(bill *Waybill) bool {