This commit is contained in:
苏尹岚
2021-03-31 15:57:50 +08:00
parent 1208b4357e
commit 3cb180a48d

View File

@@ -741,12 +741,12 @@ func GetStoresSkusNew(ctx *jxcontext.Context, storeIDs, skuIDs []int, upcs []str
sqlParams2 = append(sqlParams2, sqlParamsPage)
var storeNameList []*tStoreNameBind
beginTime := time.Now()
if err = dao.GetRowsTx(txDB, &storeNameList, sql2, sqlParams2...); err != nil {
if err = dao.GetRows(db, &storeNameList, sql2, sqlParams2...); err != nil {
dao.Rollback(db, txDB)
return nil, err
}
globals.SugarLogger.Debugf("GetStoresSkusNew get result1:%v", time.Now().Sub(beginTime))
skuNamesInfo.TotalCount = dao.GetLastTotalRowCount2(db, txDB)
skuNamesInfo.TotalCount = dao.GetLastTotalRowCount(db)
sql += " AND (1 = 0"
for _, v := range storeNameList {
sql += " OR (t1.id = ? AND t3.id = ?)"
@@ -784,12 +784,12 @@ func GetStoresSkusNew(ctx *jxcontext.Context, storeIDs, skuIDs []int, upcs []str
}
var tmpList []*tGetStoresSkusInfo
beginTime := time.Now()
if err = dao.GetRowsTx(txDB, &tmpList, sql, sqlParams...); err != nil {
if err = dao.GetRows(db, &tmpList, sql, sqlParams...); err != nil {
dao.Rollback(db, txDB)
return nil, err
}
if isBySku {
skuNamesInfo.TotalCount = dao.GetLastTotalRowCount2(db, txDB)
skuNamesInfo.TotalCount = dao.GetLastTotalRowCount(db)
}
dao.Commit(db, txDB)
globals.SugarLogger.Debugf("GetStoresSkusNew get result2:%v", time.Now().Sub(beginTime))