- isPossibleSwitch2SelfDelivery

This commit is contained in:
gazebo
2019-05-10 10:23:18 +08:00
parent f20added92
commit 9f6c978e49
3 changed files with 83 additions and 57 deletions

View File

@@ -232,3 +232,24 @@ type OrderComment struct {
CommentUpdatedAt time.Time
UpdatedOriginalMsg string `orm:"type(text)" json:"-"`
}
// 判断是否是购买平台自有物流
// 对于京东,饿百来说,就是其自有的物流,对于微商城来说,是达达
func IsWaybillPlatformOwn(bill *Waybill) bool {
return bill.OrderVendorID == bill.WaybillVendorID || IsSpecialOrderPlatformWaybill(bill)
}
// 是否是特殊物流
func IsSpecialOrderPlatformWaybill(bill *Waybill) bool {
return (bill.OrderVendorID == VendorIDWSC && bill.WaybillVendorID == VendorIDDada)
}
// 订单是否已经有了有效运单
func IsOrderHasWaybill(order *GoodsOrder) bool {
return order.WaybillVendorID != VendorIDUnknown && order.VendorWaybillID != ""
}
// 订单是否有自己平台的有效运单
func IsOrderHaveOwnWaybill(order *GoodsOrder) bool {
return order.VendorID == order.WaybillVendorID && order.VendorWaybillID != ""
}