diff --git a/controllers/taobao_vegetable.go b/controllers/taobao_vegetable.go index 809fdf278..07905d1f0 100644 --- a/controllers/taobao_vegetable.go +++ b/controllers/taobao_vegetable.go @@ -231,19 +231,16 @@ func (c *TaoBaoVegetableController) CancelOnSaleRefundOrder() { return } - if order.Status < model.OrderStatusDelivering || order.Status == model.OrderStatusCanceled { - if order.Status == model.OrderStatusCanceled { - c.Data["json"] = tao_vegetable.CallBackResultOnSaleCancel(nil) - c.ServeJSON() - } - - if order.Status >= model.OrderStatusDelivering { - c.Data["json"] = tao_vegetable.CallBackResultOnSaleCancel(fmt.Errorf("不支持售中取消")) - c.ServeJSON() - } else { - c.Data["json"] = tao_vegetable.CallBackResultOnSaleCancel(nil) - c.ServeJSON() - } + if order.Status == model.OrderStatusCanceled { + c.Data["json"] = tao_vegetable.CallBackResultOnSaleCancel(nil) + c.ServeJSON() + } + if order.Status >= model.OrderStatusDelivering { + c.Data["json"] = tao_vegetable.CallBackResultOnSaleCancel(fmt.Errorf("不支持售中取消")) + c.ServeJSON() + } else { + c.Data["json"] = tao_vegetable.CallBackResultOnSaleCancel(nil) + c.ServeJSON() } } }