结算类型
This commit is contained in:
@@ -110,6 +110,7 @@ type JxOrderInfo struct {
|
||||
StoreName string `json:"storeName"`
|
||||
Weight int `json:"weight"`
|
||||
FromStoreID int `json:"fromStoreID"`
|
||||
EarningType int `json:"earningType"`
|
||||
}
|
||||
|
||||
type DeliveryTimeItem struct {
|
||||
@@ -481,6 +482,13 @@ func generateOrder(ctx *jxcontext.Context, jxOrder *JxOrderInfo, addressID int64
|
||||
return nil, nil, fmt.Errorf("当前送货地址不在门店%s的配送范围", storeDetail.Name)
|
||||
}
|
||||
|
||||
//结算类型
|
||||
if storeDetail.PayPercentage < 50 {
|
||||
jxOrder.EarningType = model.EarningTypePoints
|
||||
} else {
|
||||
jxOrder.EarningType = model.EarningTypeQuote
|
||||
}
|
||||
|
||||
// 营业状态及时间检查
|
||||
if storeDetail.Status != model.StoreStatusOpened { // model.StoreStatusDisabled {
|
||||
return nil, nil, fmt.Errorf("门店:%s状态是:%s", storeDetail.Name, model.StoreStatusName[storeDetail.Status])
|
||||
@@ -820,6 +828,7 @@ func jxOrder2GoodsOrder(ctx *jxcontext.Context, jxOrder *JxOrderInfo, deliveryAd
|
||||
|
||||
DeliveryType: model.OrderDeliveryTypeStoreSelf,
|
||||
StatusTime: time.Now(),
|
||||
EarningType: jxOrder.EarningType,
|
||||
}
|
||||
if userID == "" {
|
||||
order.UserID = ctx.GetUserID()
|
||||
|
||||
Reference in New Issue
Block a user