aa
This commit is contained in:
@@ -1253,7 +1253,6 @@ func updateStoresSkusWithoutSync(ctx *jxcontext.Context, db *dao.DaoDB, storeIDs
|
|||||||
// if err = checkStoresSkusSaleCity(ctx, db, storeIDs, skuBindInfos); err != nil {
|
// if err = checkStoresSkusSaleCity(ctx, db, storeIDs, skuBindInfos); err != nil {
|
||||||
// return nil, err
|
// return nil, err
|
||||||
// }
|
// }
|
||||||
globals.SugarLogger.Debugf("updateStoresSkusWithoutSync2, storeIDs:%v, skuBindInfos:%s", storeIDs, utils.Format4Output(skuBindInfos, false))
|
|
||||||
isUserCanDirectChangePrice := true
|
isUserCanDirectChangePrice := true
|
||||||
if user := ctx.GetFullUser(); user != nil {
|
if user := ctx.GetFullUser(); user != nil {
|
||||||
isUserCanDirectChangePrice = user.Type&model.UserTypeOperator != 0
|
isUserCanDirectChangePrice = user.Type&model.UserTypeOperator != 0
|
||||||
@@ -1275,6 +1274,7 @@ func updateStoresSkusWithoutSync(ctx *jxcontext.Context, db *dao.DaoDB, storeIDs
|
|||||||
if err != nil || storeDetail == nil {
|
if err != nil || storeDetail == nil {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
globals.SugarLogger.Debugf("updateStoresSkusWithoutSync, step 0")
|
||||||
if beego.BConfig.RunMode == "prod" || beego.BConfig.RunMode == "beta" {
|
if beego.BConfig.RunMode == "prod" || beego.BConfig.RunMode == "beta" {
|
||||||
if len(storeIDs) > 1 {
|
if len(storeIDs) > 1 {
|
||||||
if storeDetail.StoreLevel == "D" || storeDetail.StoreLevel == "E" {
|
if storeDetail.StoreLevel == "D" || storeDetail.StoreLevel == "E" {
|
||||||
@@ -1282,10 +1282,12 @@ func updateStoresSkusWithoutSync(ctx *jxcontext.Context, db *dao.DaoDB, storeIDs
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
globals.SugarLogger.Debugf("updateStoresSkusWithoutSync, step 1")
|
||||||
scaleFactor := float64(1)
|
scaleFactor := float64(1)
|
||||||
if isScale {
|
if isScale {
|
||||||
scaleFactor = 100 / float64(jxutils.ConstrainPayPercentage(storeDetail.PayPercentage))
|
scaleFactor = 100 / float64(jxutils.ConstrainPayPercentage(storeDetail.PayPercentage))
|
||||||
}
|
}
|
||||||
|
globals.SugarLogger.Debugf("updateStoresSkusWithoutSync, step 2")
|
||||||
for _, skuBindInfo := range skuBindInfos {
|
for _, skuBindInfo := range skuBindInfos {
|
||||||
// 关注且没有给价时,需要尝试从store_sku_bind中得到已有的单价
|
// 关注且没有给价时,需要尝试从store_sku_bind中得到已有的单价
|
||||||
needGetExistingUnitPrice := skuBindInfo.UnitPrice == 0 && skuBindInfo.IsFocus == 1
|
needGetExistingUnitPrice := skuBindInfo.UnitPrice == 0 && skuBindInfo.IsFocus == 1
|
||||||
@@ -1345,7 +1347,7 @@ func updateStoresSkusWithoutSync(ctx *jxcontext.Context, db *dao.DaoDB, storeIDs
|
|||||||
// globals.SugarLogger.Debug(sql)
|
// globals.SugarLogger.Debug(sql)
|
||||||
if err = dao.GetRows(db, &allBinds, sql, sqlParams...); err == nil {
|
if err = dao.GetRows(db, &allBinds, sql, sqlParams...); err == nil {
|
||||||
if len(allBinds) > 0 {
|
if len(allBinds) > 0 {
|
||||||
// globals.SugarLogger.Debug(utils.Format4Output(allBinds, false))
|
globals.SugarLogger.Debug(utils.Format4Output(allBinds, true))
|
||||||
inSkuBinsMap := make(map[int]*StoreSkuBindSkuInfo, len(inSkuBinds))
|
inSkuBinsMap := make(map[int]*StoreSkuBindSkuInfo, len(inSkuBinds))
|
||||||
for _, v := range inSkuBinds {
|
for _, v := range inSkuBinds {
|
||||||
inSkuBinsMap[v.SkuID] = v
|
inSkuBinsMap[v.SkuID] = v
|
||||||
|
|||||||
Reference in New Issue
Block a user