定时更改商品可售状态
This commit is contained in:
@@ -659,20 +659,18 @@ func (v *VendorSync) ChangeStoreSkuSaleStatus(ctx *jxcontext.Context, isAsync, i
|
||||
storeIDs []int
|
||||
skuIDs []int
|
||||
)
|
||||
vendorIDs := partner.GetPurchasePlatformVendorIDs()
|
||||
db := dao.GetDB()
|
||||
storeSkuList, err := dao.GetStoresSkusInfoBySaleTime(db)
|
||||
if len(storeSkuList) < 1 || err != nil {
|
||||
return errors.New(fmt.Sprintf("未查询到设置了可售时间的商品 GetStoresSkusInfoBySaleTime!err : %v", err))
|
||||
}
|
||||
for _, v := range storeSkuList {
|
||||
storeIDs = append(storeIDs, v.StoreID)
|
||||
skuIDs = append(skuIDs, v.SkuID)
|
||||
setStoreSkuBindStatus(v, model.SyncFlagSaleMask)
|
||||
dao.UpdateEntity(db, v)
|
||||
}
|
||||
if len(storeSkuList) > 0 {
|
||||
v.SyncStoresSkus(ctx, db, vendorIDs, storeIDs, skuIDs, false, isAsync, isContinueWhenError)
|
||||
} else {
|
||||
return errors.New("未查询到设置了可售时间的商品!")
|
||||
}
|
||||
vendorIDs := partner.GetPurchasePlatformVendorIDs()
|
||||
dao.UpdateStoreSkuBindSyncStatus(db, vendorIDs)
|
||||
v.SyncStoresSkus(ctx, db, vendorIDs, storeIDs, skuIDs, false, isAsync, isContinueWhenError)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user