1
This commit is contained in:
@@ -283,7 +283,7 @@ var (
|
||||
}
|
||||
)
|
||||
|
||||
func GetStoresSkusForStore(ctx *jxcontext.Context, storeID int, isFocus, isAct bool, keyword string, categoryID, status, offset, pageSize int) (skuNamesInfo *dao.StoreSkuNamesInfo2, err error) {
|
||||
func GetStoresSkusForStore(ctx *jxcontext.Context, storeID int, isFocus, isAct bool, keyword string, categoryID, status, offset, pageSize int, stock, locationCode bool) (skuNamesInfo *dao.StoreSkuNamesInfo2, err error) {
|
||||
var (
|
||||
sqlParams []interface{}
|
||||
db = dao.GetDB()
|
||||
@@ -375,10 +375,18 @@ func GetStoresSkusForStore(ctx *jxcontext.Context, storeID int, isFocus, isAct b
|
||||
sql += " AND c.sku_id IS NULL AND (a.status = ? AND b.status = ?)"
|
||||
sqlParams = append(sqlParams, model.SkuStatusNormal, model.SkuStatusNormal)
|
||||
}
|
||||
if stock {
|
||||
sql += " AND c.stock = 0"
|
||||
}
|
||||
if locationCode {
|
||||
sql += " AND c.location_code = ''"
|
||||
}
|
||||
|
||||
if keyword != "" {
|
||||
sql += " AND a.name LIKE ?"
|
||||
sqlParams = append(sqlParams, "%"+keyword+"%")
|
||||
}
|
||||
|
||||
sql += `
|
||||
LIMIT ? OFFSET ?
|
||||
`
|
||||
@@ -1156,8 +1164,6 @@ func GetStoresSkusNew(ctx *jxcontext.Context, storeIDs, skuIDs []int, upcs []str
|
||||
if isHighPrice || priceType != 0 {
|
||||
sql += " , t4.unit_price DESC LIMIT 99"
|
||||
}
|
||||
globals.SugarLogger.Debugf("-----sql := %s", sql)
|
||||
globals.SugarLogger.Debugf("-----sqlParams := %s", utils.Format4Output(sqlParams, false))
|
||||
var tmpList []*tGetStoresSkusInfo
|
||||
if err = dao.GetRowsTx(txDB, &tmpList, sql, sqlParams...); err != nil {
|
||||
dao.Rollback(db, txDB)
|
||||
|
||||
@@ -50,7 +50,6 @@ func CreateStoreCategoryByStoreSku(ctx *jxcontext.Context, vendorID, storeID int
|
||||
}()
|
||||
for i := 0; i < 2; i++ {
|
||||
localCats, err2 := dao.GetSkusCategories(db, vendorID, storeID, skuIDs, i+1)
|
||||
globals.SugarLogger.Debugf("----------localCats:= %s", utils.Format4Output(localCats, false))
|
||||
if err = err2; err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user