修改价格计算判断条件
This commit is contained in:
parent
b67ee2d265
commit
d9ac040b15
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user