Merge branch 'mark' into get-store
This commit is contained in:
@@ -374,3 +374,15 @@ func GuessVendorIDFromVendorStoreID(vendorStoreID int64) (vendorID int) {
|
||||
func GetVendorName(vendorID int) (vendorName string) {
|
||||
return model.VendorChineseNames[vendorID]
|
||||
}
|
||||
|
||||
func CaculateSkuEarningPrice(shopPrice, salePrice int64, storePayPercentage int) (earningPrice int64) {
|
||||
earningPrice = salePrice
|
||||
if shopPrice > 0 && shopPrice < earningPrice {
|
||||
earningPrice = shopPrice
|
||||
}
|
||||
if storePayPercentage <= 0 {
|
||||
storePayPercentage = model.DefaultEarningPricePercentage
|
||||
}
|
||||
earningPrice = earningPrice * int64(storePayPercentage) / 100
|
||||
return earningPrice
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user