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.
26 lines
553 B
26 lines
553 B
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()) |
|
} |
|
}
|
|
|