This commit is contained in:
邹宗楠
2023-08-28 15:58:58 +08:00
parent ec3b5d1a9f
commit ddad83cd06
2 changed files with 25 additions and 5 deletions

View File

@@ -2457,13 +2457,24 @@ func DelOrderSkuInfo(ctx *jxcontext.Context, vendorOrderID string, vendorID, id
}
for _, v := range order.Skus {
if v.ID == int64(id) {
sql := `
if v.Count == model.YES {
sql := `
DELETE FROM order_sku WHERE id = ?
`
sqlParams := []interface{}{v.ID}
dao.ExecuteSQL(db, sql, sqlParams)
shopPrice = v.ShopPrice * int64(v.Count)
earningPrice = v.EarningPrice * int64(v.Count)
sqlParams := []interface{}{v.ID}
dao.ExecuteSQL(db, sql, sqlParams)
} else {
sql := `
UPDATE order_sku SET count = ? WHERE id = ?
`
sqlParams := []interface{}{v.Count - 1, v.ID}
dao.ExecuteSQL(db, sql, sqlParams)
}
shopPrice = v.ShopPrice * int64(1)
earningPrice = v.EarningPrice * int64(1)
//shopPrice = v.ShopPrice * int64(v.Count)
//earningPrice = v.EarningPrice * int64(v.Count)
}
}
order.ShopPrice -= shopPrice

View File

@@ -395,6 +395,15 @@ func (c *PurchaseHandler) onOrderMsg(msg *mtwmapi.CallbackMsg) (response *mtwmap
c.OnOrderDetail(orderMap, partner.UpdatedPeration)
}
})
// 美团订单完成时,获取跑腿费用
if fee, feeErr := partner.GetPurchasePlatformFromVendorID(order.VendorID).GetPlatformLogisticsFee(order); feeErr != nil {
bill, err := partner.CurOrderManager.LoadWaybill(order.VendorOrderID, model.VendorIDMTWM)
if bill == nil && err == nil {
bill.ActualFee = fee
bill.DesiredFee = fee
dao.UpdateEntity(dao.GetDB(), bill, "ActualFee", "DesiredFee")
}
}
}
}