package models import ( "github.com/liangdas/mqant/log" "github.com/olivere/elastic/v7" "server/common" "server/db" ) func QueryOneIncome(su *int64, channel *int, income *common.ESIncomeStatistics) { q := elastic.NewBoolQuery() if su != nil { q.Must(elastic.NewMatchQuery("Time", *su)) } if channel != nil { q.Must(elastic.NewMatchQuery("Channel", *channel)) } else { q.Must(elastic.NewMatchQuery("Channel", 0)) } err := db.ES().QueryOne(common.ESIndexBackIncomeStatistics, q, income) if err != nil { log.Error(err.Error()) } }