1
This commit is contained in:
@@ -1930,7 +1930,6 @@ func updateStoresSkusWithoutSync(ctx *jxcontext.Context, db *dao.DaoDB, storeIDs
|
|||||||
panic(r)
|
panic(r)
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
globals.SugarLogger.Debugf("----------------------------1")
|
|
||||||
for _, storeID := range storeIDs {
|
for _, storeID := range storeIDs {
|
||||||
// todo 可以考虑在需要更新价格再获取
|
// todo 可以考虑在需要更新价格再获取
|
||||||
storeDetail, err := dao.GetStoreDetail(dao.GetDB(), storeID, model.VendorIDJX, "")
|
storeDetail, err := dao.GetStoreDetail(dao.GetDB(), storeID, model.VendorIDJX, "")
|
||||||
@@ -2005,7 +2004,6 @@ func updateStoresSkusWithoutSync(ctx *jxcontext.Context, db *dao.DaoDB, storeIDs
|
|||||||
FOR UPDATE`
|
FOR UPDATE`
|
||||||
sqlParams = append(sqlParams, utils.DefaultTimeValue)
|
sqlParams = append(sqlParams, utils.DefaultTimeValue)
|
||||||
// globals.SugarLogger.Debug(sql)
|
// globals.SugarLogger.Debug(sql)
|
||||||
globals.SugarLogger.Debugf("----------------------------2")
|
|
||||||
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 {
|
||||||
inSkuBinsMap := make(map[int]*StoreSkuBindSkuInfo, len(inSkuBinds))
|
inSkuBinsMap := make(map[int]*StoreSkuBindSkuInfo, len(inSkuBinds))
|
||||||
@@ -2167,7 +2165,6 @@ func updateStoresSkusWithoutSync(ctx *jxcontext.Context, db *dao.DaoDB, storeIDs
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
globals.SugarLogger.Debugf("----------------------------3")
|
|
||||||
// 用了SELECT FOR UPDATE后,只更新修改字段是没有必要的,暂时保留
|
// 用了SELECT FOR UPDATE后,只更新修改字段是没有必要的,暂时保留
|
||||||
updateFieldMap := make(map[string]interface{})
|
updateFieldMap := make(map[string]interface{})
|
||||||
if skuBindInfo.IsFocus == 1 { // 关注之后再关注不操作
|
if skuBindInfo.IsFocus == 1 { // 关注之后再关注不操作
|
||||||
@@ -2182,7 +2179,6 @@ func updateStoresSkusWithoutSync(ctx *jxcontext.Context, db *dao.DaoDB, storeIDs
|
|||||||
// updateFieldMap["Price"] = 1
|
// updateFieldMap["Price"] = 1
|
||||||
}
|
}
|
||||||
if tmpStatus := getSkuSaleStatus(inSkuBind, skuBindInfo); tmpStatus != model.StoreSkuBindStatusNA {
|
if tmpStatus := getSkuSaleStatus(inSkuBind, skuBindInfo); tmpStatus != model.StoreSkuBindStatusNA {
|
||||||
globals.SugarLogger.Debugf("----------------------------4")
|
|
||||||
if tmpStatus != skuBind.Status {
|
if tmpStatus != skuBind.Status {
|
||||||
updateFieldMap[model.FieldStatus] = 1
|
updateFieldMap[model.FieldStatus] = 1
|
||||||
}
|
}
|
||||||
@@ -2191,6 +2187,8 @@ func updateStoresSkusWithoutSync(ctx *jxcontext.Context, db *dao.DaoDB, storeIDs
|
|||||||
setStoreSkuBindStatus(skuBind, model.SyncFlagStockMask)
|
setStoreSkuBindStatus(skuBind, model.SyncFlagStockMask)
|
||||||
if tmpStatus == model.StoreSkuBindStatusNormal {
|
if tmpStatus == model.StoreSkuBindStatusNormal {
|
||||||
globals.SugarLogger.Debugf("----------------------------5")
|
globals.SugarLogger.Debugf("----------------------------5")
|
||||||
|
globals.SugarLogger.Debugf("---------------------------5skuBind %s", utils.Format4Output(&skuBind, false))
|
||||||
|
globals.SugarLogger.Debugf("---------------------------5skuBind %s", utils.Format4Output(&inSkuBind, false))
|
||||||
if skuBind.Stock == 0 && beego.BConfig.RunMode != model.ServerTypePet {
|
if skuBind.Stock == 0 && beego.BConfig.RunMode != model.ServerTypePet {
|
||||||
skuBind.Stock = model.MaxStoreSkuStockQty
|
skuBind.Stock = model.MaxStoreSkuStockQty
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user