fix 修复可购买为false的bug
All checks were successful
Build image / build (push) Successful in 54s

This commit is contained in:
timerzz 2024-09-14 21:07:09 +08:00
parent d6a767ca3b
commit 1f77559f49

View File

@ -73,6 +73,7 @@ func (c *Controller) Rate(ctx context.Context, idString string) error {
// 到这里说明成本和售价有变动
article.CostPrice = Decimal(cost)
article.SellPrice = Decimal(sell)
article.Available = available
if cost > 0 {
article.Rate = Decimal((article.SellPrice - article.CostPrice) * 100 / article.CostPrice)
}