1
This commit is contained in:
@@ -380,16 +380,13 @@ func GetStoresSkusForStore(ctx *jxcontext.Context, storeID int, isFocus, isAct b
|
||||
} else if stock == 2 {
|
||||
sql += " AND c.stock <> 0"
|
||||
}
|
||||
if locationCode2 != "" {
|
||||
sql += " AND c.location_code = ?"
|
||||
sqlParams = append(sqlParams, locationCode2)
|
||||
} else if locationCode {
|
||||
if locationCode {
|
||||
sql += " AND (c.location_code = '' OR c.location_code = 'EMPTY_VALUE') "
|
||||
}
|
||||
|
||||
if keyword != "" {
|
||||
sql += " AND a.name LIKE ?"
|
||||
sqlParams = append(sqlParams, "%"+keyword+"%")
|
||||
sql += " AND a.name LIKE ? OR c.location_code LIKE ?"
|
||||
sqlParams = append(sqlParams, "%"+keyword+"%", "%"+keyword+"%")
|
||||
}
|
||||
|
||||
sql += `
|
||||
@@ -615,8 +612,8 @@ func getGetStoresSkusBaseSQL(db *dao.DaoDB, storeIDs, skuIDs []int, upcs []strin
|
||||
}
|
||||
if keyword != "" {
|
||||
keywordLike := "%" + keyword + "%"
|
||||
sql += " AND (t1.name LIKE ? OR t1.prefix LIKE ? OR t1.upc LIKE ? OR t2.comment LIKE ?"
|
||||
sqlParams = append(sqlParams, keywordLike, keywordLike, keywordLike, keywordLike)
|
||||
sql += " AND (t1.name LIKE ? OR t1.prefix LIKE ? OR t1.upc LIKE ? OR t2.comment LIKE ? OR t4.location_code LIKE ? "
|
||||
sqlParams = append(sqlParams, keywordLike, keywordLike, keywordLike, keywordLike, keywordLike)
|
||||
|
||||
if keywordInt64, err2 := strconv.ParseInt(keyword, 10, 64); err2 == nil {
|
||||
sql += `
|
||||
@@ -762,10 +759,7 @@ func getGetStoresSkusBaseSQL(db *dao.DaoDB, storeIDs, skuIDs []int, upcs []strin
|
||||
sql += " AND t4.stock <= ? "
|
||||
sqlParams = append(sqlParams, params["maxStock"])
|
||||
}
|
||||
if params["locationCode"] != "" && params["locationCode"] != nil {
|
||||
sql += " AND t4.location_code LIKE ? "
|
||||
sqlParams = append(sqlParams, "%"+params["locationCode"].(string)+"%")
|
||||
} else if params["isLocationCode"] != "" && params["isLocationCode"] != nil {
|
||||
if params["isLocationCode"] != "" && params["isLocationCode"] != nil {
|
||||
sql += " AND (t4.location_code = '' OR t4.location_code = 'EMPTY_VALUE') "
|
||||
}
|
||||
return sql, sqlParams, err
|
||||
|
||||
@@ -96,7 +96,6 @@ func (c *StoreSkuController) GetStoreSkus() {
|
||||
// @Param minimumPrice query string false "查询最低价"
|
||||
// @Param minStock query int false "最小库存"
|
||||
// @Param maxStock query int false "最大库存"
|
||||
// @Param locationCode query string false "货架码"
|
||||
// @Param isLocationCode query bool false "是否有货架码"
|
||||
// @Success 200 {object} controllers.CallResult
|
||||
// @Failure 200 {object} controllers.CallResult
|
||||
@@ -1017,7 +1016,6 @@ func (c *StoreSkuController) GetVendorStoreSkus() {
|
||||
// @Param isFocus query bool true "是否已关注(认领)"
|
||||
// @Param stock query int false "库存是否为0[1-全查/2-有库存/3-没库存]"
|
||||
// @Param locationCode query bool false "商品位置是否为空"
|
||||
// @Param locationCode2 query string false "商品位置编码"
|
||||
// @Param keyword query string false "查询关键字(可以为空,为空表示不限制)"
|
||||
// @Param categoryID query int false "商品所属类别ID"
|
||||
// @Param status query int false "查询起始状态(0:不可售,1:可售,-1 全部)"
|
||||
|
||||
Reference in New Issue
Block a user