From e811b3fc752d2462d0052ec6d65094a61bf72da0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Tue, 24 Dec 2019 17:51:27 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E7=95=85=E9=94=80=E5=95=86=E5=93=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/cms/store_sku.go | 4 ++-- business/model/dao/store_sku.go | 12 +++++++----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/business/jxstore/cms/store_sku.go b/business/jxstore/cms/store_sku.go index 6d137da56..47075a09d 100644 --- a/business/jxstore/cms/store_sku.go +++ b/business/jxstore/cms/store_sku.go @@ -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 diff --git a/business/model/dao/store_sku.go b/business/model/dao/store_sku.go index 89c43e16d..b5b870fcf 100644 --- a/business/model/dao/store_sku.go +++ b/business/model/dao/store_sku.go @@ -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 From afa708ab99237f8b4105a299277b5ad43c007808 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Tue, 24 Dec 2019 18:11:13 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E7=95=85=E9=94=80=E5=95=86=E5=93=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/model/dao/store_sku.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/business/model/dao/store_sku.go b/business/model/dao/store_sku.go index b5b870fcf..f31f2f26a 100644 --- a/business/model/dao/store_sku.go +++ b/business/model/dao/store_sku.go @@ -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 ` From 955663449933f8be7f54f2f928c667d4f44390e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Tue, 24 Dec 2019 18:24:01 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E7=95=85=E9=94=80=E5=95=86=E5=93=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/cms/store_sku.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/business/jxstore/cms/store_sku.go b/business/jxstore/cms/store_sku.go index 47075a09d..ffab3276c 100644 --- a/business/jxstore/cms/store_sku.go +++ b/business/jxstore/cms/store_sku.go @@ -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) From c124acc53ab41666e2d969b3b81bbf23cb86f27e Mon Sep 17 00:00:00 2001 From: suyl <770236076@qq.com> Date: Tue, 24 Dec 2019 21:00:02 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E5=95=86=E5=93=81=E5=89=8D=E7=BC=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/model/dao/store_sku.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/business/model/dao/store_sku.go b/business/model/dao/store_sku.go index f31f2f26a..c34d5c6ca 100644 --- a/business/model/dao/store_sku.go +++ b/business/model/dao/store_sku.go @@ -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 {