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