Commit 77160b4c by mushishixian

修改查询条件

parent b4d186e5
Showing with 11 additions and 3 deletions
......@@ -187,6 +187,12 @@ func getUpdateGoodsData(bomId int, bomItems []model.BomItem, deliveryType, sort
return nil, err
}
}
} else {
index = index + ",zhuanmai,liexin_ziying"
goodsMapList, err = search(index, bomId, bomItems, deliveryType, sort, client, rawSearch)
if err != nil {
return nil, err
}
}
return
}
......@@ -263,9 +269,9 @@ func getSearchParams(index, goodsName, brandName string, sort, number int, flag
}
//要去判断sort,sort=2是按照价格排序
if sort == 2 {
if index != "liexin_ziying" {
source.Sort("single_price_sort", false)
}
//if index != "liexin_ziying" {
// source.Sort("single_price_sort", false)
//}
source.Sort("single_price", true)
//sort=3是按照库存排序
} else if sort == 3 {
......@@ -299,6 +305,8 @@ func getTermQuery(goodsName, brandName string, number int, flag bool) (query *es
field := "auto_goods_name"
query = query.Must(es.NewTermQuery(field, goodsName))
}
query = query.Filter(es.NewRangeQuery("single_price").Gt(0))
query = query.Filter(es.NewRangeQuery("stock").Gt(0))
query = query.Filter(es.NewTermQuery("status", 1))
//query = query.Filter(es.NewRangeQuery("single_price").Gt(0))
//src, err := query.Source()
......
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