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
647544b8
authored
Jan 11, 2024
by
SUDPTDUBLXEROFX\Administrator
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
分类
parent
8807400c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletions
service/optimum_service.go
service/optimum_service.go
View file @
647544b8
...
@@ -86,6 +86,7 @@ func (qs *OptimumService) GetOptimumAttr(ctx *gin.Context) (results model.LyResp
...
@@ -86,6 +86,7 @@ func (qs *OptimumService) GetOptimumAttr(ctx *gin.Context) (results model.LyResp
results
.
ErrorMsg
=
err
.
Error
()
results
.
ErrorMsg
=
err
.
Error
()
return
return
}
}
//查询es
//查询es
esResult
,
err
:=
es
.
CurlESNew
(
"goods_optimum"
,
queryString
)
esResult
,
err
:=
es
.
CurlESNew
(
"goods_optimum"
,
queryString
)
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -96,7 +97,7 @@ func (qs *OptimumService) GetOptimumAttr(ctx *gin.Context) (results model.LyResp
...
@@ -96,7 +97,7 @@ func (qs *OptimumService) GetOptimumAttr(ctx *gin.Context) (results model.LyResp
common
.
PrintDebugHtml
(
ctx
,
esResult
)
common
.
PrintDebugHtml
(
ctx
,
esResult
)
//判断返回总条数
//判断返回总条数
total
:=
gjson
.
Get
(
esResult
,
"hits.total"
)
.
Int
()
total
:=
gjson
.
Get
(
esResult
,
"hits.total
.value
"
)
.
Int
()
if
total
==
0
{
if
total
==
0
{
results
.
ErrorCode
=
0
results
.
ErrorCode
=
0
results
.
ErrorMsg
=
"查询没有数据"
results
.
ErrorMsg
=
"查询没有数据"
...
@@ -194,6 +195,8 @@ func (qs *OptimumService) GetOptimumAttrInfo(ctx *gin.Context) (results model.Ly
...
@@ -194,6 +195,8 @@ func (qs *OptimumService) GetOptimumAttrInfo(ctx *gin.Context) (results model.Ly
results
.
ErrorMsg
=
err
.
Error
()
results
.
ErrorMsg
=
err
.
Error
()
return
return
}
}
common
.
PrintDebugHtml
(
ctx
,
queryString
)
esResult
,
err
:=
es
.
CurlESNew
(
"goods_optimum"
,
queryString
)
esResult
,
err
:=
es
.
CurlESNew
(
"goods_optimum"
,
queryString
)
if
err
!=
nil
{
if
err
!=
nil
{
results
.
ErrorCode
=
0
results
.
ErrorCode
=
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