分类

parent 8807400c
Showing with 4 additions and 1 deletions
......@@ -86,6 +86,7 @@ func (qs *OptimumService) GetOptimumAttr(ctx *gin.Context) (results model.LyResp
results.ErrorMsg = err.Error()
return
}
//查询es
esResult, err := es.CurlESNew("goods_optimum", queryString)
if err != nil {
......@@ -96,7 +97,7 @@ func (qs *OptimumService) GetOptimumAttr(ctx *gin.Context) (results model.LyResp
common.PrintDebugHtml(ctx, esResult)
//判断返回总条数
total := gjson.Get(esResult, "hits.total").Int()
total := gjson.Get(esResult, "hits.total.value").Int()
if total == 0 {
results.ErrorCode = 0
results.ErrorMsg = "查询没有数据"
......@@ -194,6 +195,8 @@ func (qs *OptimumService) GetOptimumAttrInfo(ctx *gin.Context) (results model.Ly
results.ErrorMsg = err.Error()
return
}
common.PrintDebugHtml(ctx, queryString)
esResult, err := es.CurlESNew("goods_optimum", queryString)
if err != nil {
results.ErrorCode = 0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment