修改美团跑腿取消订单的违约金扣除
This commit is contained in:
@@ -576,13 +576,13 @@ func (a *API) OrderLogisticsFee(orderID int64) (payFee float64, err error) {
|
||||
}
|
||||
data := result.(map[string]interface{})
|
||||
// 美团运单,骑手确认订单之后取消的话就需要扣除全部的运单费用了,到店之后取消订单也不支付骑手配送费
|
||||
//if utils.Interface2Int64WithDefault(data["logistics_status"], 0) == utils.Str2Int64WithDefault(WaybillStatusCanceled, 0) {
|
||||
// if utils.Interface2Int64WithDefault(data["confirm_time"], 0) != 0 {
|
||||
// return utils.TryInterface2Float64(data["pay_amount"])
|
||||
// } else {
|
||||
// return 0, nil
|
||||
// }
|
||||
//}
|
||||
if utils.Interface2Int64WithDefault(data["logistics_status"], 0) == utils.Str2Int64WithDefault(WaybillStatusCanceled, 0) {
|
||||
if utils.Interface2Int64WithDefault(data["dispatcher_reach_poi_time"], 0) != 0 {
|
||||
return 2, nil
|
||||
} else {
|
||||
return 0, nil
|
||||
}
|
||||
}
|
||||
|
||||
return utils.TryInterface2Float64(data["pay_amount"])
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ func TestOrderLogisticsStatus(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestOrderLogisticsFee(t *testing.T) {
|
||||
result, err := api.OrderLogisticsFee(900697881770969420)
|
||||
result, err := api.OrderLogisticsFee(900699270657684955)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user