From d9ac040b1564ea5323dc77cd57dca3afc6d588b5 Mon Sep 17 00:00:00 2001 From: jhc <9316338+wangyitao309@user.noreply.gitee.com> Date: Sun, 12 Feb 2023 19:13:24 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BB=B7=E6=A0=BC=E8=AE=A1?= =?UTF-8?q?=E7=AE=97=E5=88=A4=E6=96=AD=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/serializer/calc_price.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/serializer/calc_price.go b/pkg/serializer/calc_price.go index 54bae47..2b03e77 100644 --- a/pkg/serializer/calc_price.go +++ b/pkg/serializer/calc_price.go @@ -39,7 +39,7 @@ func CalcPrice(total_price int64, total_ruler int32, artworksPrices []*model.Art maxId, dirId := findArtworkToAdd(artworksPrices, int64(price)) - if dirId > 0 { + if dirId >= 0 { artworksPrices[dirId].Price = artworksPrices[dirId].Price + loss_total_price } else { artworksPrices[maxId].Price = artworksPrices[maxId].Price + loss_total_price @@ -60,7 +60,7 @@ func CalcPrice(total_price int64, total_ruler int32, artworksPrices []*model.Art } } - if dirId > 0 { + if dirId >= 0 { artworksPrices[dirId].ArtworkPrice = artworksPrices[dirId].ArtworkPrice + loss_artwork_price } else { artworksPrices[maxId].ArtworkPrice = artworksPrices[maxId].ArtworkPrice + loss_artwork_price @@ -77,7 +77,7 @@ func CalcPrice(total_price int64, total_ruler int32, artworksPrices []*model.Art } } - if dirId > 0 { + if dirId >= 0 { artworksPrices[dirId].CopyrightPrice = artworksPrices[dirId].CopyrightPrice + loss_copyright_price } else { artworksPrices[maxId].CopyrightPrice = artworksPrices[maxId].CopyrightPrice + loss_copyright_price