畅销品查询,查询活动增加payPercentage(bug)
This commit is contained in:
@@ -2282,22 +2282,26 @@ func GetTopSkusByCityCode(ctx *jxcontext.Context, cityCode, storeID int) (skuNam
|
||||
skuList, _ := dao.GetSkus(db, nil, []int{v.ID}, nil, nil)
|
||||
v.Skus = skuList
|
||||
for _, vv := range skuList {
|
||||
var storeSkuNameExt []*dao.StoreSkuNameExt
|
||||
var skusList []*dao.StoreSkuExt
|
||||
var (
|
||||
storeSkuNameExt []*dao.StoreSkuNameExt
|
||||
skusList []*dao.StoreSkuExt
|
||||
price int
|
||||
specQuality float64
|
||||
)
|
||||
skus := &dao.StoreSkuExt{
|
||||
SkuID: vv.ID,
|
||||
}
|
||||
skusList = append(skusList, skus)
|
||||
storeSkuName := &dao.StoreSkuNameExt{
|
||||
Skus: skusList,
|
||||
StoreID: storeID,
|
||||
Skus: skusList,
|
||||
StoreID: storeID,
|
||||
PayPercentage: payPercentage,
|
||||
}
|
||||
storeSkuNameExt = append(storeSkuNameExt, storeSkuName)
|
||||
skuNamesInfo := &dao.StoreSkuNamesInfo{
|
||||
SkuNames: storeSkuNameExt,
|
||||
}
|
||||
dao.UpdateActPrice4StoreSkuNameNew(db, []int{storeID}, []int{vv.ID}, skuNamesInfo, -1)
|
||||
vv.StoreSkuStatus = model.StoreSkuBindStatusDontSale
|
||||
if skuNamesInfo.SkuNames[0].Skus[0] != nil {
|
||||
vv.ActPrice = skuNamesInfo.SkuNames[0].Skus[0].ActPrice
|
||||
vv.ActID = skuNamesInfo.SkuNames[0].Skus[0].ActID
|
||||
@@ -2305,6 +2309,18 @@ func GetTopSkusByCityCode(ctx *jxcontext.Context, cityCode, storeID int) (skuNam
|
||||
vv.EarningPrice = skuNamesInfo.SkuNames[0].Skus[0].EarningPrice
|
||||
vv.EarningActID = skuNamesInfo.SkuNames[0].Skus[0].EarningActID
|
||||
}
|
||||
vv.StoreSkuStatus = model.StoreSkuBindStatusDontSale
|
||||
if vv.Unit == model.SpecialUnit {
|
||||
if vv.SpecUnit == model.SpecUnitNames[1] || vv.SpecUnit == model.SpecUnitNames[2] {
|
||||
specQuality = float64(vv.SpecQuality) * 1000
|
||||
} else {
|
||||
specQuality = float64(vv.SpecQuality)
|
||||
}
|
||||
price = int(utils.Float64TwoInt64(specQuality / utils.Int2Float64(model.SpecialSpecQuality) * utils.Int2Float64(v.UnitPrice)))
|
||||
} else {
|
||||
price = v.UnitPrice
|
||||
}
|
||||
vv.Price = price
|
||||
}
|
||||
skuNameAndPlaceList = append(skuNameAndPlaceList, v)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user