作者 tangxvhui

bug 修复

... ... @@ -266,6 +266,12 @@ func (service OrderService) RemoveOrder(id int64) error {
if err != nil {
return lib.ThrowError(lib.TRANSACTION_ERROR, err.Error())
}
if err = transactionContext.StartTransaction(); err != nil {
return lib.ThrowError(lib.TRANSACTION_ERROR, err.Error())
}
defer func() {
transactionContext.RollbackTransaction()
}()
var (
orderRepository domain.OrderRepository
order *domain.Order
... ... @@ -290,6 +296,10 @@ func (service OrderService) RemoveOrder(id int64) error {
if err != nil {
return lib.ThrowError(lib.INTERNAL_SERVER_ERROR, err.Error())
}
err = transactionContext.CommitTransaction()
if err != nil {
return lib.ThrowError(lib.INTERNAL_SERVER_ERROR, err.Error())
}
return nil
}
... ...
... ... @@ -166,14 +166,14 @@ func (c *OrderController) GetOrderPurpose() {
"updateTime": orderinfo.UpdateAt.Local().Format("2006-01-02 15:04:05"),
"buyer": orderinfo.Buyer.BuyerName,
"buyerPhone": orderinfo.Buyer.ContactInfo,
"Address": orderinfo.Buyer.ShippingAddress,
"address": orderinfo.Buyer.ShippingAddress,
"id": orderinfo.Id,
"partner": orderinfo.PartnerInfo.Id,
"partnerRatio": orderinfo.PartnerBonusPercent,
"salesmanRatio": orderinfo.SalesmanBonusPercent,
"orderId": orderinfo.OrderCode,
"orderName": orderinfo.OrderName,
"OrderNum": orderinfo.OrderCount,
"orderNum": orderinfo.OrderCount,
"orderPrice": orderinfo.OrderAmount,
"orderDist": orderinfo.OrderRegionInfo.RegionName,
"orderStatue": orderinfo.OrderStatus,
... ... @@ -385,14 +385,14 @@ func (c *OrderController) GetOrderReal() {
"updateTime": orderinfo.UpdateAt.Local().Format("2006-01-02 15:04:05"),
"buyer": orderinfo.Buyer.BuyerName,
"buyerPhone": orderinfo.Buyer.ContactInfo,
"Address": orderinfo.Buyer.ShippingAddress,
"address": orderinfo.Buyer.ShippingAddress,
"id": orderinfo.Id,
"partner": orderinfo.PartnerInfo.Id,
"partnerRatio": orderinfo.PartnerBonusPercent,
"salesmanRatio": orderinfo.SalesmanBonusPercent,
"orderId": orderinfo.OrderCode,
"orderName": orderinfo.OrderName,
"OrderNum": orderinfo.OrderActualCount,
"orderNum": orderinfo.OrderActualCount,
"orderPrice": orderinfo.OrderActualAmount,
"orderDist": orderinfo.OrderRegionInfo.RegionName,
"orderStatue": orderinfo.OrderStatus,
... ...