添加平台门店免运配置,当前只有京东实现了

This commit is contained in:
gazebo
2019-10-14 14:41:40 +08:00
parent dd7eea1a02
commit 11526da5db
6 changed files with 146 additions and 20 deletions

View File

@@ -366,6 +366,8 @@ type StoreMap struct {
PricePercentage int16 `orm:"default(100)" json:"pricePercentage"` // todo 厂商价格相对于本地价格的百分比,这个字段的修改会比较特殊,因为可能需要刷新厂商价格
PricePercentagePack string `orm:"size(32)" json:"pricePercentagePack"` //
FreightDeductionPack string `orm:"size(32)" json:"freightDeductionPack"` //
AutoPickup int8 `orm:"default(1)" json:"autoPickup"` // 是否自动拣货
DeliveryType int8 `orm:"default(0)" json:"deliveryType"` // 配送类型
DeliveryFee int `json:"deliveryFee"`
@@ -454,7 +456,7 @@ func (v *VendorStoreSnapshot) CompareOperationTime(s2 *VendorStoreSnapshot) int
}
type PricePercentageItem struct {
BeginPrice int `json:"beginPrice"` // 始价格区间(包括)
BeginPrice int `json:"beginPrice"` // 始价格区间(包括)
PricePercentage int `json:"pricePercentage"` // 调价比例
}
@@ -476,3 +478,31 @@ func (l PricePercentagePack) Swap(i, j int) {
l[i] = l[j]
l[j] = tmp
}
type FreightDeductionItem struct {
BeginPrice int `json:"beginPrice"` // 起始价格区间(包括)
DeductFreight int `json:"deductFreight"` // 减免运费
}
type FreightDeductionPack struct {
StartPrice int `json:"startPrice"` // 起送价
FreightDeductionList []*FreightDeductionItem `json:"freightDeductionList"`
}
func (l *FreightDeductionPack) Len() int {
return len(l.FreightDeductionList)
}
// Less reports whether the element with
// index i should sort before the element with index j.
func (l *FreightDeductionPack) Less(i, j int) bool {
return l.FreightDeductionList[i].BeginPrice < l.FreightDeductionList[j].BeginPrice
}
// Swap swaps the elements with indexes i and j.
func (l *FreightDeductionPack) Swap(i, j int) {
l2 := l.FreightDeductionList
tmp := l2[i]
l2[i] = l2[j]
l2[j] = tmp
}