- AutoSaleStoreSku添加参数isNeedSync控制是否主动同步,定时任务不需要,因为马上就是每晚的定时同步
This commit is contained in:
@@ -2181,7 +2181,7 @@ func GetMissingStoreSkuFromOrder(ctx *jxcontext.Context, fromTime time.Time) (mi
|
|||||||
return missingList, err
|
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()
|
db := dao.GetDB()
|
||||||
storeSkuList, err := dao.GetAutoSaleStoreSku(db, storeIDs)
|
storeSkuList, err := dao.GetAutoSaleStoreSku(db, storeIDs)
|
||||||
if err != nil {
|
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 {
|
if _, err = CurVendorSync.SyncStoresSkus(ctx, db, nil, []int{storeID}, skuIDs, false, true, true); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,23 +45,8 @@ var (
|
|||||||
"00:01:00",
|
"00:01:00",
|
||||||
}
|
}
|
||||||
|
|
||||||
autoEnableStoreSkuTimeList = []string{
|
autoSaleStoreSkuTimeList = []string{
|
||||||
"7:00:00",
|
"20:50: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",
|
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -91,8 +76,8 @@ func Init() {
|
|||||||
}, updateActStatusTimeList)
|
}, updateActStatusTimeList)
|
||||||
}
|
}
|
||||||
ScheduleTimerFunc(func() {
|
ScheduleTimerFunc(func() {
|
||||||
cms.AutoSaleStoreSku(jxcontext.AdminCtx, nil)
|
cms.AutoSaleStoreSku(jxcontext.AdminCtx, nil, false)
|
||||||
}, autoEnableStoreSkuTimeList)
|
}, autoSaleStoreSkuTimeList)
|
||||||
}
|
}
|
||||||
|
|
||||||
func doDailyWork() {
|
func doDailyWork() {
|
||||||
|
|||||||
@@ -30,9 +30,3 @@ func (*PageShop) TableUnique() [][]string {
|
|||||||
[]string{"VendorStoreID", "VendorID"},
|
[]string{"VendorStoreID", "VendorID"},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (*PageShop) TableIndex() [][]string {
|
|
||||||
return [][]string{
|
|
||||||
[]string{"Tel1"},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user