批量关注修改
This commit is contained in:
@@ -2872,6 +2872,7 @@ func FocusStoreSkusByExcelBin(ctx *jxcontext.Context, reader io.Reader, isAsync,
|
|||||||
}
|
}
|
||||||
for k, v := range skuNameMap {
|
for k, v := range skuNameMap {
|
||||||
skuBindInfo := &StoreSkuBindInfo{
|
skuBindInfo := &StoreSkuBindInfo{
|
||||||
|
StoreID: store.ID,
|
||||||
NameID: k,
|
NameID: k,
|
||||||
UnitPrice: v,
|
UnitPrice: v,
|
||||||
IsFocus: 1,
|
IsFocus: 1,
|
||||||
@@ -2893,7 +2894,7 @@ func FocusStoreSkusByExcelBin(ctx *jxcontext.Context, reader io.Reader, isAsync,
|
|||||||
case 2:
|
case 2:
|
||||||
for _, v := range result1 {
|
for _, v := range result1 {
|
||||||
tUpdate := v.(*tUpdateStoresSkus)
|
tUpdate := v.(*tUpdateStoresSkus)
|
||||||
UpdateStoresSkus(ctx, []int{tUpdate.StoreID}, tUpdate.SkuBindInfos, false, isAsync, isContinueWhenError)
|
UpdateStoresSkusByBind(ctx, tUpdate.SkuBindInfos, true, true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result, err
|
return result, err
|
||||||
@@ -3048,12 +3049,13 @@ func AutoFocusStoreSkusWithoutFocusForTopSkus(ctx *jxcontext.Context) (err error
|
|||||||
payPercentage = v.PayPercentage
|
payPercentage = v.PayPercentage
|
||||||
}
|
}
|
||||||
if len(skuNameAndPlaceList) > 0 {
|
if len(skuNameAndPlaceList) > 0 {
|
||||||
for _, v := range skuNameAndPlaceList {
|
for _, vv := range skuNameAndPlaceList {
|
||||||
if skuNameMap[v.ID] != 0 {
|
if skuNameMap[vv.ID] != 0 {
|
||||||
priceReferList, err := dao.GetPriceReferSnapshotNoPage(db, []int{v.CityCode}, nil, []int{v.ID}, utils.Time2Date(time.Now().AddDate(0, 0, -1)))
|
priceReferList, err := dao.GetPriceReferSnapshotNoPage(db, []int{vv.CityCode}, nil, []int{vv.ID}, utils.Time2Date(time.Now().AddDate(0, 0, -1)))
|
||||||
if err == nil && len(priceReferList) > 0 {
|
if err == nil && len(priceReferList) > 0 {
|
||||||
storeSkuBindInfo := &StoreSkuBindInfo{
|
storeSkuBindInfo := &StoreSkuBindInfo{
|
||||||
NameID: v.ID,
|
StoreID: v.ID,
|
||||||
|
NameID: vv.ID,
|
||||||
UnitPrice: priceReferList[0].MidUnitPrice * payPercentage / 100,
|
UnitPrice: priceReferList[0].MidUnitPrice * payPercentage / 100,
|
||||||
IsFocus: 1,
|
IsFocus: 1,
|
||||||
IsSale: 0,
|
IsSale: 0,
|
||||||
@@ -3063,7 +3065,7 @@ func AutoFocusStoreSkusWithoutFocusForTopSkus(ctx *jxcontext.Context) (err error
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
UpdateStoreSkus(ctx, v.ID, skuBindInfoList, true, true)
|
UpdateStoresSkusByBind(ctx, skuBindInfoList, true, true)
|
||||||
}
|
}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user