最低价显示

This commit is contained in:
苏尹岚
2020-08-21 10:10:09 +08:00
parent 5f06161241
commit 9c0e0e71a2
4 changed files with 14 additions and 6 deletions

View File

@@ -424,7 +424,6 @@ func getActRule(vendorID, actType int) (actRule *tActRuleInfo, err error) {
func checkDiscountValidation(vendorIDs []int, actType int, pricePercentage float64) (err error) { func checkDiscountValidation(vendorIDs []int, actType int, pricePercentage float64) (err error) {
pricePercentageMin := int(math.Floor(pricePercentage)) pricePercentageMin := int(math.Floor(pricePercentage))
pricePercentageMax := int(math.Ceil(pricePercentage)) pricePercentageMax := int(math.Ceil(pricePercentage))
fmt.Println(pricePercentageMin, pricePercentageMax, pricePercentage)
errList := errlist.New() errList := errlist.New()
for _, vendorID := range vendorIDs { for _, vendorID := range vendorIDs {
actRule, err2 := getActRule(vendorID, actType) actRule, err2 := getActRule(vendorID, actType)

View File

@@ -204,6 +204,9 @@ type ActStoreSku2 struct {
MapID int `orm:"column(map_id)"` MapID int `orm:"column(map_id)"`
Type int `json:"type"` Type int `json:"type"`
DiscountType int `json:"discountType"`
DiscountValue1 int `json:"discountValue1"`
DiscountValue2 int `json:"discountValue2"`
ActStoreSku ActStoreSku
VendorID int `orm:"column(vendor_id)" json:"vendorID"` VendorID int `orm:"column(vendor_id)" json:"vendorID"`

View File

@@ -373,7 +373,7 @@ func GetEffectiveActStoreSkuInfo(db *DaoDB, actID int, vendorIDs []int, actType
} }
sql := ` sql := `
SELECT SELECT
t1.type, t1.type, t1.discount_type, t1.discount_value1, t1.discount_value2,
t2.*, t2.*,
t3.actual_act_price, t3.sync_status, t3.vendor_price, t3.vendor_id, t3.trend_type, t3.trend_price t3.actual_act_price, t3.sync_status, t3.vendor_price, t3.vendor_id, t3.trend_type, t3.trend_price
FROM act t1 FROM act t1

View File

@@ -263,6 +263,9 @@ type StoreSkuExt struct {
ActPrice int `json:"actPrice"` ActPrice int `json:"actPrice"`
ActID int `orm:"column(act_id)" json:"actID"` ActID int `orm:"column(act_id)" json:"actID"`
ActType int `orm:"column(act_type)" json:"actType"` ActType int `orm:"column(act_type)" json:"actType"`
DiscountType int `json:"discountType"`
DiscountValue1 int `json:"discountValue1"`
DiscountValue2 int `json:"discountValue2"`
EarningPrice int `json:"earningPrice"` EarningPrice int `json:"earningPrice"`
EarningActID int `orm:"column(earning_act_id)" json:"earningActID"` EarningActID int `orm:"column(earning_act_id)" json:"earningActID"`
@@ -1370,6 +1373,9 @@ func UpdateActPrice4StoreSkuNameNew(db *DaoDB, storeIDs, skuIDs []int, skuNamesI
v.EarningPrice = int(jxutils.CaculateSkuEarningPrice(int64(v.BindPrice), int64(v.ActPrice), skuName.PayPercentage)) v.EarningPrice = int(jxutils.CaculateSkuEarningPrice(int64(v.BindPrice), int64(v.ActPrice), skuName.PayPercentage))
v.TrendType = actStoreSku.TrendType v.TrendType = actStoreSku.TrendType
v.TrendPrice = actStoreSku.TrendPrice v.TrendPrice = actStoreSku.TrendPrice
v.DiscountType = actStoreSku.DiscountType
v.DiscountValue1 = actStoreSku.DiscountValue1
v.DiscountValue2 = actStoreSku.DiscountValue2
} }
if actStoreSku := actStoreSkuMap4EarningPrice.GetActStoreSku(skuName.StoreID, v.SkuID, -1); actStoreSku != nil { if actStoreSku := actStoreSkuMap4EarningPrice.GetActStoreSku(skuName.StoreID, v.SkuID, -1); actStoreSku != nil {
v.EarningPrice = int(actStoreSku.EarningPrice) v.EarningPrice = int(actStoreSku.EarningPrice)