测试updatestoresskus
This commit is contained in:
@@ -1048,7 +1048,6 @@ func updateStoresSkusWithoutSync(ctx *jxcontext.Context, db *dao.DaoDB, storeIDs
|
||||
if user := ctx.GetFullUser(); user != nil {
|
||||
isUserCanDirectChangePrice = user.Type&model.UserTypeOperator != 0
|
||||
}
|
||||
fmt.Println("test11111111111111111111111111111111111")
|
||||
userName := ctx.GetUserName()
|
||||
needSyncIDMap := make(map[int]int)
|
||||
dao.Begin(db)
|
||||
@@ -1060,12 +1059,12 @@ func updateStoresSkusWithoutSync(ctx *jxcontext.Context, db *dao.DaoDB, storeIDs
|
||||
}()
|
||||
for _, storeID := range storeIDs {
|
||||
// todo 可以考虑在需要更新价格再获取
|
||||
fmt.Println("test22222222222222222222222222222222222222222")
|
||||
storeDetail, err := dao.GetStoreDetail(dao.GetDB(), storeID, model.VendorIDJX)
|
||||
if err != nil {
|
||||
dao.Rollback(db)
|
||||
return nil, err
|
||||
}
|
||||
fmt.Println("test22222222222222222222222222222222222222222")
|
||||
scaleFactor := float64(1)
|
||||
if isScale {
|
||||
scaleFactor = 100 / float64(jxutils.ConstrainPayPercentage(storeDetail.PayPercentage))
|
||||
@@ -1112,7 +1111,6 @@ func updateStoresSkusWithoutSync(ctx *jxcontext.Context, db *dao.DaoDB, storeIDs
|
||||
sqlParams = append(sqlParams, skuBindInfo.NameID, utils.DefaultTimeValue)
|
||||
// globals.SugarLogger.Debug(sql)
|
||||
if err = dao.GetRows(db, &allBinds, sql, sqlParams...); err == nil {
|
||||
fmt.Println("test3333333333333333333333333333333333333333")
|
||||
if len(allBinds) > 0 {
|
||||
// globals.SugarLogger.Debug(utils.Format4Output(allBinds, false))
|
||||
inSkuBinsMap := make(map[int]*StoreSkuBindSkuInfo, len(inSkuBinds))
|
||||
@@ -1308,6 +1306,7 @@ func updateStoresSkusWithoutSync(ctx *jxcontext.Context, db *dao.DaoDB, storeIDs
|
||||
}
|
||||
}
|
||||
} else {
|
||||
fmt.Println("test3333333333333333333333333333333333333333")
|
||||
dao.Rollback(db)
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user