mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
added tests for filter statmetric
This commit is contained in:
committed by
Dan Christian Bogos
parent
3d9a94c5c5
commit
22b96ca1e3
@@ -1481,7 +1481,7 @@ func (sqls *SQLStorage) GetTPTrends(tpid, tenant, id string) ([]*utils.TPTrendsP
|
||||
}
|
||||
|
||||
func (sqls *SQLStorage) GetTPRankings(tpid string, tenant string, id string) ([]*utils.TPRankingProfile, error) {
|
||||
var sgs RankingsMdls
|
||||
var rgs RankingsMdls
|
||||
q := sqls.db.Where("tpid = ?", tpid)
|
||||
if len(id) != 0 {
|
||||
q = q.Where("id = ?", id)
|
||||
@@ -1489,10 +1489,10 @@ func (sqls *SQLStorage) GetTPRankings(tpid string, tenant string, id string) ([]
|
||||
if len(tenant) != 0 {
|
||||
q = q.Where("tenant = ?", tenant)
|
||||
}
|
||||
if err := q.Find(&sgs).Error; err != nil {
|
||||
if err := q.Find(&rgs).Error; err != nil {
|
||||
return nil, err
|
||||
}
|
||||
asgs := sgs.AsTPRanking()
|
||||
asgs := rgs.AsTPRanking()
|
||||
if len(asgs) == 0 {
|
||||
return asgs, utils.ErrNotFound
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user