|
@@ -22,9 +22,7 @@ type EnterpriseSearch struct {
|
|
|
|
|
|
PageSize int //每页数量
|
|
|
PageNum int //页码
|
|
|
- Total int //一共多少条
|
|
|
IsVip bool //是否是会员
|
|
|
-
|
|
|
}
|
|
|
|
|
|
const (
|
|
@@ -129,10 +127,13 @@ func (es *EnterpriseSearch) GetQuerySql() string {
|
|
|
func (es *EnterpriseSearch) DoQuery() (list *[]map[string]interface{}, total int64, err error) {
|
|
|
sql := es.GetQuerySql()
|
|
|
log.Println("EnterpriseSearch DoQuery sql", sql)
|
|
|
+
|
|
|
start, limit := es.PageNum*es.PageSize, es.PageSize
|
|
|
+ total = -1
|
|
|
+
|
|
|
if !es.IsVip {
|
|
|
- start, limit, total = 0, freeSearchNum, -1
|
|
|
- } else if total == 0 {
|
|
|
+ start, limit = 0, freeSearchNum
|
|
|
+ } else if start == 0 {
|
|
|
if total = elastic.Count(index, itype, sql); total == 0 {
|
|
|
return
|
|
|
}
|