This commit is contained in:
苏尹岚
2021-03-26 11:13:07 +08:00
parent 1100724061
commit 11740281ca
2 changed files with 4 additions and 1 deletions

View File

@@ -1267,6 +1267,9 @@ func (c *OrderManager) AmendMissingOrders(ctx *jxcontext.Context, vendorIDs []in
if model.IsOrderFinalStatus(order.Status) { if model.IsOrderFinalStatus(order.Status) {
goodsOrder.Status = order.Status goodsOrder.Status = order.Status
goodsOrder.OrderFinishedAt = order.OrderFinishedAt goodsOrder.OrderFinishedAt = order.OrderFinishedAt
if goodsOrder.OrderFinishedAt == utils.DefaultTimeValue {
goodsOrder.OrderFinishedAt = goodsOrder.OrderCreatedAt.Add(time.Hour)
}
_, err = dao.UpdateEntity(db, goodsOrder, "Status", "OrderFinishedAt") _, err = dao.UpdateEntity(db, goodsOrder, "Status", "OrderFinishedAt")
} }
} }

View File

@@ -1603,7 +1603,7 @@ func OrderProfitWarning(order *model.GoodsOrder) {
} }
} else { } else {
if payPercentage >= 50 { if payPercentage >= 50 {
profit = utils.Str2Float64(utils.Int64ToStr(order.TotalShopMoney-order.ShopPrice)) / 100 profit = utils.Str2Float64(utils.Int64ToStr(order.TotalShopMoney-order.EarningPrice)) / 100
} else { } else {
profit = utils.Str2Float64(utils.Int64ToStr(order.TotalShopMoney*int64(payPercentage)/200)) / 100 profit = utils.Str2Float64(utils.Int64ToStr(order.TotalShopMoney*int64(payPercentage)/200)) / 100
} }