aa
This commit is contained in:
@@ -1827,24 +1827,30 @@ func UploadJdsImage(ctx *jxcontext.Context) (err error) {
|
||||
// })
|
||||
// }
|
||||
var (
|
||||
db = dao.GetDB()
|
||||
idList []*jdapi.SkuIdEntity
|
||||
db = dao.GetDB()
|
||||
idLists [][]*jdapi.SkuIdEntity
|
||||
k = 1
|
||||
)
|
||||
storeMaps, _ := dao.GetStoresMapList(db, []int{model.VendorIDJD}, []int{667281}, nil, model.StoreStatusAll, model.StoreIsSyncAll, "", "", "320406")
|
||||
things, _ := dao.GetThingMapList(db, model.ThingTypeSku, []int{model.VendorIDJD}, nil, []string{"320406"})
|
||||
for _, v := range things {
|
||||
if v.VendorThingID != "" {
|
||||
for i := 0; i < len(things)/50+1; i += 50 {
|
||||
var idList []*jdapi.SkuIdEntity
|
||||
for j := i; j < 50*k; j++ {
|
||||
idList = append(idList, &jdapi.SkuIdEntity{
|
||||
OutSkuId: utils.Int64ToStr(v.ThingID),
|
||||
OutSkuId: utils.Int64ToStr(things[j].ThingID),
|
||||
})
|
||||
idLists = append(idLists, idList)
|
||||
}
|
||||
k++
|
||||
}
|
||||
task := tasksch.NewParallelTask("uuuuu", tasksch.NewParallelConfig().SetIsContinueWhenError(true), ctx,
|
||||
func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
|
||||
storeMap := batchItemList[0].(*model.StoreMap)
|
||||
err = api.JdAPI.DelVipPrice(utils.Int2Str(storeMap.StoreID), idList, "suyl")
|
||||
if strings.Contains(err.Error(), "没有会员价") {
|
||||
err = nil
|
||||
for _, v := range idLists {
|
||||
err = api.JdAPI.DelVipPrice(utils.Int2Str(storeMap.StoreID), v, "suyl")
|
||||
if strings.Contains(err.Error(), "没有会员价") {
|
||||
err = nil
|
||||
}
|
||||
}
|
||||
return retVal, err
|
||||
}, storeMaps)
|
||||
|
||||
Reference in New Issue
Block a user