- isPossibleSwitch2SelfDelivery
This commit is contained in:
@@ -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 != ""
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user