mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
updated trend structure && model
This commit is contained in:
committed by
Dan Christian Bogos
parent
b1218c4ae3
commit
58e419b002
@@ -1462,7 +1462,7 @@ func (sqls *SQLStorage) GetTPStats(tpid, tenant, id string) ([]*utils.TPStatProf
|
||||
}
|
||||
|
||||
func (sqls *SQLStorage) GetTPTrends(tpid, tenant, id string) ([]*utils.TPTrendsProfile, error) {
|
||||
var srs TrendsMdls
|
||||
var trs TrendsMdls
|
||||
q := sqls.db.Where("tpid = ?", tpid)
|
||||
if len(id) != 0 {
|
||||
q = q.Where("id = ?", id)
|
||||
@@ -1470,14 +1470,14 @@ func (sqls *SQLStorage) GetTPTrends(tpid, tenant, id string) ([]*utils.TPTrendsP
|
||||
if len(tenant) != 0 {
|
||||
q = q.Where("tenant = ?", tenant)
|
||||
}
|
||||
if err := q.Find(&srs).Error; err != nil {
|
||||
if err := q.Find(&trs).Error; err != nil {
|
||||
return nil, err
|
||||
}
|
||||
asrs := srs.AsTPTrends()
|
||||
if len(asrs) == 0 {
|
||||
return asrs, utils.ErrNotFound
|
||||
atrs := trs.AsTPTrends()
|
||||
if len(atrs) == 0 {
|
||||
return atrs, utils.ErrNotFound
|
||||
}
|
||||
return asrs, nil
|
||||
return atrs, nil
|
||||
}
|
||||
|
||||
func (sqls *SQLStorage) GetTPRankings(tpid string, tenant string, id string) ([]*utils.TPRankingProfile, error) {
|
||||
|
||||
Reference in New Issue
Block a user