刷新商品可售状态
This commit is contained in:
@@ -778,7 +778,7 @@ func UpdateStore(ctx *jxcontext.Context, storeID int, payload map[string]interfa
|
|||||||
}
|
}
|
||||||
notifyStoreOperatorChanged(store, valid["operatorPhone"])
|
notifyStoreOperatorChanged(store, valid["operatorPhone"])
|
||||||
if valid["openTime1"] != 0 || valid["closeTime1"] != 0 || valid["openTime2"] != 0 || valid["closeTime2"] != 0 {
|
if valid["openTime1"] != 0 || valid["closeTime1"] != 0 || valid["openTime2"] != 0 || valid["closeTime2"] != 0 {
|
||||||
err = CurVendorSync.ChangeStoreSkuSaleStatus(ctx, true, false, storeID)
|
err = CurVendorSync.ChangeStoreSkuSaleStatus(ctx, storeID, true, false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -654,7 +654,7 @@ func (v *VendorSync) SyncSkuNames(ctx *jxcontext.Context, nameIDs []int, isForce
|
|||||||
return v.SyncSkus(ctx, db, nameIDs, nil, isAsync, isContinueWhenError, ctx.GetUserName())
|
return v.SyncSkus(ctx, db, nameIDs, nil, isAsync, isContinueWhenError, ctx.GetUserName())
|
||||||
}
|
}
|
||||||
|
|
||||||
func (v *VendorSync) ChangeStoreSkuSaleStatus(ctx *jxcontext.Context, isAsync, isContinueWhenError bool, storeID int) (err error) {
|
func (v *VendorSync) ChangeStoreSkuSaleStatus(ctx *jxcontext.Context, storeID int, isAsync, isContinueWhenError bool) (err error) {
|
||||||
var (
|
var (
|
||||||
storeIDs []int
|
storeIDs []int
|
||||||
skuIDs []int
|
skuIDs []int
|
||||||
@@ -669,7 +669,7 @@ func (v *VendorSync) ChangeStoreSkuSaleStatus(ctx *jxcontext.Context, isAsync, i
|
|||||||
skuIDs = append(skuIDs, v.SkuID)
|
skuIDs = append(skuIDs, v.SkuID)
|
||||||
}
|
}
|
||||||
vendorIDs := partner.GetPurchasePlatformVendorIDs()
|
vendorIDs := partner.GetPurchasePlatformVendorIDs()
|
||||||
dao.UpdateStoreSkuBindSyncStatus(db, vendorIDs)
|
dao.UpdateStoreSkuBindSyncStatus(db, vendorIDs, storeID)
|
||||||
v.SyncStoresSkus(ctx, db, vendorIDs, storeIDs, skuIDs, false, isAsync, isContinueWhenError)
|
v.SyncStoresSkus(ctx, db, vendorIDs, storeIDs, skuIDs, false, isAsync, isContinueWhenError)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|||||||
@@ -134,7 +134,7 @@ func Init() {
|
|||||||
"04:05:06",
|
"04:05:06",
|
||||||
})
|
})
|
||||||
ScheduleTimerFunc("ChangeStoreSkuSaleStatus", func() {
|
ScheduleTimerFunc("ChangeStoreSkuSaleStatus", func() {
|
||||||
cms.CurVendorSync.ChangeStoreSkuSaleStatus(jxcontext.AdminCtx, true, false, 0)
|
cms.CurVendorSync.ChangeStoreSkuSaleStatus(jxcontext.AdminCtx, 0, true, false)
|
||||||
}, ChangeStoreSkuSaleStatusList)
|
}, ChangeStoreSkuSaleStatusList)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -609,7 +609,7 @@ func GetStoresSkusInfoBySaleTime(db *DaoDB, storeID int) (storeSkuBindList []*mo
|
|||||||
return storeSkuBindList, err
|
return storeSkuBindList, err
|
||||||
}
|
}
|
||||||
|
|
||||||
func UpdateStoreSkuBindSyncStatus(db *DaoDB, vendorIDs []int) (num int64, err error) {
|
func UpdateStoreSkuBindSyncStatus(db *DaoDB, vendorIDs []int, storeID int) (num int64, err error) {
|
||||||
sql := `
|
sql := `
|
||||||
UPDATE store_sku_bind
|
UPDATE store_sku_bind
|
||||||
SET
|
SET
|
||||||
@@ -634,5 +634,9 @@ func UpdateStoreSkuBindSyncStatus(db *DaoDB, vendorIDs []int) (num int64, err er
|
|||||||
AND status_sale_end <> 0
|
AND status_sale_end <> 0
|
||||||
`
|
`
|
||||||
sqlParams = append(sqlParams, model.StoreSkuBindStatusNormal, utils.DefaultTimeValue)
|
sqlParams = append(sqlParams, model.StoreSkuBindStatusNormal, utils.DefaultTimeValue)
|
||||||
|
if storeID > 0 {
|
||||||
|
sql += ` AND store_id = ?`
|
||||||
|
sqlParams = append(sqlParams, storeID)
|
||||||
|
}
|
||||||
return ExecuteSQL(db, sql, sqlParams...)
|
return ExecuteSQL(db, sql, sqlParams...)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user