印度包网
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

23 lines
530 B

package models
import (
"server/common"
"server/db"
"github.com/olivere/elastic/v7"
)
// 获取下载数量
func GetDownloadCount(start, end *int64, Channel *int) int64 {
q := NewQ(start, end, nil, Channel)
if Channel != nil {
q.Must(elastic.NewMatchQuery("Channel", *Channel))
}
return db.ES().Count(common.ESIndexBackOpenRecord, q)
}
// 获取下载数量
func GetDownloadCounts(start, end *int64, Channel ...*int) int64 {
q := NewQ(start, end, Channel...)
return db.ES().Count(common.ESIndexBackOpenRecord, q)
}