Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
杨树贤
/
search_server
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
635b0e33
authored
Dec 07, 2020
by
huangchengyi
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
拦截分类参数不得为空
parent
0809dfcf
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
service/query/optimum_query.go
service/query/optimum_query.go
View file @
635b0e33
package
query
import
(
"errors"
"github.com/gin-gonic/gin"
"gopkg.in/olivere/elastic.v5"
"search_server/pkg/common"
...
...
@@ -30,6 +31,11 @@ func GetOptimumAttrQuery(ctx *gin.Context,REQUEST_ATTR *map[string][]string,type
if
class_id2
!=
""
{
query
.
Must
(
elastic
.
NewTermQuery
(
"class_id2"
,
class_id2
))
}
if
class_id1
==
""
&&
class_id2
==
""
{
return
""
,
errors
.
New
(
"分类参数不得为空"
)
}
if
ctx
.
Request
.
FormValue
(
"avail_rank"
)
==
"1"
{
//只显示有货
query
.
Must
(
elastic
.
NewRangeQuery
(
"stock"
)
.
Gt
(
0
))
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment