Merge branch 'mark' of e.coding.net:rosydev/jx-callback into mark

This commit is contained in:
gazebo
2019-12-24 21:01:22 +08:00
2 changed files with 14 additions and 12 deletions

View File

@@ -892,9 +892,9 @@ func uniqueStoreNameBind(skuBindInfos []*StoreSkuBindInfo) (outSkuBindInfos []*S
}
func updateStoresSkusWithoutSync(ctx *jxcontext.Context, db *dao.DaoDB, storeIDs []int, skuBindInfos []*StoreSkuBindInfo, isScale bool) (needSyncSkus []int, err error) {
if len(storeIDs)*len(skuBindInfos) > maxStoreNameBind2 {
return nil, fmt.Errorf("门店商品信息大于%d", maxStoreNameBind2)
}
// if len(storeIDs)*len(skuBindInfos) > maxStoreNameBind2 {
// return nil, fmt.Errorf("门店商品信息大于%d", maxStoreNameBind2)
// }
storeIDs = uniqueStoreIDs(storeIDs)
skuBindInfos = uniqueStoreNameBind(skuBindInfos)
@@ -2235,8 +2235,8 @@ func GetTopSkusByCityCode(ctx *jxcontext.Context, cityCode, storeID int) (skuNam
}
for _, v := range skuNameAndPlace {
if skuNameMap[v.ID] != nil {
midPrice, err := dao.GetMidPriceByNameID(db, cityCode, v.ID, utils.Time2Date(time.Now().AddDate(0, 0, -1)))
if err == nil {
midPrice, _ := dao.GetMidPriceByNameID(db, cityCode, v.ID, utils.Time2Date(time.Now().AddDate(0, 0, -1)))
if midPrice != 0 {
v.Price = midPrice
}
v.Type = skuNameMap[v.ID].BrandID

View File

@@ -929,7 +929,7 @@ func UpdateStoreSkuBindSyncStatusForExPrefix(db *DaoDB, vendorIDs []int) (num in
for _, v := range vendorIDs {
fieldPrefix := ConvertDBFieldPrefix(model.VendorNames[v])
sql += ` %s_sync_status = %s_sync_status | ?,`
fmtParams = append(fmtParams, fieldPrefix)
fmtParams = append(fmtParams, fieldPrefix, fieldPrefix)
sqlParams = append(sqlParams, model.SyncFlagModifiedMask)
}
} else {
@@ -1084,7 +1084,7 @@ func GetTopSkusByCityCode(db *DaoDB, cityCode int, orderCreate time.Time) (skuNa
JOIN place e ON e.code = d.city_code
WHERE 1=1
AND b.sale_price > ?
AND a.created_at BETWEEN ? and NOW()
AND a.order_created_at BETWEEN ? and NOW()
GROUP BY 2,3,4
ORDER BY count DESC
`
@@ -1352,7 +1352,7 @@ func GetMidPriceByNameID(db *DaoDB, cityCode, skuNameID int, snapDate time.Time)
skuMap = make(map[int]int)
)
sql := `
SELECT a.mid_price bind_price,a.sku_id,b.spec_quality
SELECT a.mid_price bind_price,a.sku_id,b.spec_quality sku_spec_quality
FROM price_refer_snapshot a
JOIN sku b ON a.sku_id = b.id
JOIN sku_name c ON c.id = b.name_id
@@ -1369,10 +1369,12 @@ func GetMidPriceByNameID(db *DaoDB, cityCode, skuNameID int, snapDate time.Time)
if err != nil {
return 0, err
}
for _, v := range storeSkuExt {
price = model.SpecialSpecQuality / int(utils.Float64TwoInt64(float64(v.SkuSpecQuality))) * v.BindPrice
if skuMap[skuNameID] < price {
skuMap[skuNameID] = price
if len(storeSkuExt) > 0 {
for _, v := range storeSkuExt {
price = model.SpecialSpecQuality / int(utils.Float64TwoInt64(float64(v.SkuSpecQuality))) * v.BindPrice
if skuMap[skuNameID] < price {
skuMap[skuNameID] = price
}
}
}
return skuMap[skuNameID], err