aa
This commit is contained in:
@@ -4362,7 +4362,7 @@ type QueryPageSkusResult struct {
|
||||
CityName string `json:"cityName"`
|
||||
}
|
||||
|
||||
func QueryPageSkus(ctx *jxcontext.Context, vendorID int, vendorStoreID, keyword string, lng, lat float64, radius, offset, pageSize int) (pagedInfo *model.PagedInfo, err error) {
|
||||
func QueryPageSkus(ctx *jxcontext.Context, vendorID int, vendorStoreIDs []string, keyword string, lng, lat float64, radius, offset, pageSize int) (pagedInfo *model.PagedInfo, err error) {
|
||||
var (
|
||||
db = dao.GetDB()
|
||||
results []*QueryPageSkusResult
|
||||
@@ -4410,9 +4410,9 @@ func QueryPageSkus(ctx *jxcontext.Context, vendorID int, vendorStoreID, keyword
|
||||
sql += " AND t1.sku_name LIKE ?"
|
||||
sqlParams = append(sqlParams, keywordLike)
|
||||
}
|
||||
if vendorStoreID != "" {
|
||||
sql += " AND t1.store_id LIKE ?"
|
||||
sqlParams = append(sqlParams, "%"+vendorStoreID+"%")
|
||||
if len(vendorStoreIDs) > 0 {
|
||||
sql += " AND t1.store_id IN (" + dao.GenQuestionMarks(len(vendorStoreIDs)) + ")"
|
||||
sqlParams = append(sqlParams, vendorStoreIDs)
|
||||
}
|
||||
sql += `
|
||||
LIMIT ? OFFSET ?
|
||||
|
||||
@@ -154,7 +154,7 @@ func (c *NetSpiderController) RefreshPageShops() {
|
||||
// @Description 参考信息,商品搜索
|
||||
// @Param token header string true "认证token"
|
||||
// @Param vendorID query int false "平台ID"
|
||||
// @Param vendorStoreID query string false "门店ID"
|
||||
// @Param vendorStoreIDs query string false "门店ID"
|
||||
// @Param keyword query string false "关键字"
|
||||
// @Param lng query string false "关注点经度"
|
||||
// @Param lat query string false "关注点纬度"
|
||||
@@ -166,7 +166,9 @@ func (c *NetSpiderController) RefreshPageShops() {
|
||||
// @router /QueryPageSkus [get]
|
||||
func (c *NetSpiderController) QueryPageSkus() {
|
||||
c.callQueryPageSkus(func(params *tNetspiderQueryPageSkusParams) (retVal interface{}, errCode string, err error) {
|
||||
retVal, err = cms.QueryPageSkus(params.Ctx, params.VendorID, params.VendorStoreID, params.Keyword, utils.Str2Float64WithDefault(params.Lng, 0), utils.Str2Float64WithDefault(params.Lat, 0), params.Radius, params.Offset, params.PageSize)
|
||||
var vendorStoreIDs []string
|
||||
jxutils.Strings2Objs(params.VendorStoreIDs, &vendorStoreIDs)
|
||||
retVal, err = cms.QueryPageSkus(params.Ctx, params.VendorID, vendorStoreIDs, params.Keyword, utils.Str2Float64WithDefault(params.Lng, 0), utils.Str2Float64WithDefault(params.Lat, 0), params.Radius, params.Offset, params.PageSize)
|
||||
return retVal, "", err
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user