From 972636e4346d8ac76918d326eba8fbaa318525d8 Mon Sep 17 00:00:00 2001 From: gazebo Date: Sat, 3 Aug 2019 22:26:03 +0800 Subject: [PATCH] =?UTF-8?q?-=20AutoSaleStoreSku=E6=B7=BB=E5=8A=A0=E5=8F=82?= =?UTF-8?q?=E6=95=B0isNeedSync=E6=8E=A7=E5=88=B6=E6=98=AF=E5=90=A6?= =?UTF-8?q?=E4=B8=BB=E5=8A=A8=E5=90=8C=E6=AD=A5=EF=BC=8C=E5=AE=9A=E6=97=B6?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E4=B8=8D=E9=9C=80=E8=A6=81=EF=BC=8C=E5=9B=A0?= =?UTF-8?q?=E4=B8=BA=E9=A9=AC=E4=B8=8A=E5=B0=B1=E6=98=AF=E6=AF=8F=E6=99=9A?= =?UTF-8?q?=E7=9A=84=E5=AE=9A=E6=97=B6=E5=90=8C=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/cms/store_sku.go | 4 ++-- business/jxstore/misc/misc.go | 23 ++++------------------- business/model/net_spider.go | 6 ------ 3 files changed, 6 insertions(+), 27 deletions(-) diff --git a/business/jxstore/cms/store_sku.go b/business/jxstore/cms/store_sku.go index 43645afa7..6b587a43c 100644 --- a/business/jxstore/cms/store_sku.go +++ b/business/jxstore/cms/store_sku.go @@ -2181,7 +2181,7 @@ func GetMissingStoreSkuFromOrder(ctx *jxcontext.Context, fromTime time.Time) (mi return missingList, err } -func AutoSaleStoreSku(ctx *jxcontext.Context, storeIDs []int) (err error) { +func AutoSaleStoreSku(ctx *jxcontext.Context, storeIDs []int, isNeedSync bool) (err error) { db := dao.GetDB() storeSkuList, err := dao.GetAutoSaleStoreSku(db, storeIDs) if err != nil { @@ -2206,7 +2206,7 @@ func AutoSaleStoreSku(ctx *jxcontext.Context, storeIDs []int) (err error) { } } } - if len(skuIDs) > 0 { + if isNeedSync && len(skuIDs) > 0 { if _, err = CurVendorSync.SyncStoresSkus(ctx, db, nil, []int{storeID}, skuIDs, false, true, true); err != nil { return err } diff --git a/business/jxstore/misc/misc.go b/business/jxstore/misc/misc.go index b4b126001..b9a6cb73a 100644 --- a/business/jxstore/misc/misc.go +++ b/business/jxstore/misc/misc.go @@ -45,23 +45,8 @@ var ( "00:01:00", } - autoEnableStoreSkuTimeList = []string{ - "7:00:00", - "8:00:00", - "9:00:00", - "10:00:00", - "11:00:00", - "12:00:00", - "13:00:00", - "14:00:00", - "15:00:00", - "16:00:00", - "17:00:00", - "18:00:00", - "19:00:00", - "20:00:00", - "21:00:00", - "22:00:00", + autoSaleStoreSkuTimeList = []string{ + "20:50:00", } ) @@ -91,8 +76,8 @@ func Init() { }, updateActStatusTimeList) } ScheduleTimerFunc(func() { - cms.AutoSaleStoreSku(jxcontext.AdminCtx, nil) - }, autoEnableStoreSkuTimeList) + cms.AutoSaleStoreSku(jxcontext.AdminCtx, nil, false) + }, autoSaleStoreSkuTimeList) } func doDailyWork() { diff --git a/business/model/net_spider.go b/business/model/net_spider.go index d7b747e29..bf9e909b2 100644 --- a/business/model/net_spider.go +++ b/business/model/net_spider.go @@ -30,9 +30,3 @@ func (*PageShop) TableUnique() [][]string { []string{"VendorStoreID", "VendorID"}, } } - -func (*PageShop) TableIndex() [][]string { - return [][]string{ - []string{"Tel1"}, - } -}