mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-24 08:38:45 +05:00
Start adding OrderBy Paramert for filterCDR
This commit is contained in:
committed by
Dan Christian Bogos
parent
ce76251554
commit
2765a24a06
@@ -1042,6 +1042,11 @@ func (self *SQLStorage) GetCDRs(qryFltr *utils.CDRsFilter, remove bool) ([]*CDR,
|
||||
if qryFltr.UpdatedAtEnd != nil && !qryFltr.UpdatedAtEnd.IsZero() {
|
||||
q = q.Where("updated_at < ?", qryFltr.UpdatedAtEnd)
|
||||
}
|
||||
// need to check if it's descencent
|
||||
// after that make a switch to make the parameter compatible
|
||||
if qryFltr.OrderBy != "" {
|
||||
q = q.Order(qryFltr.OrderBy)
|
||||
}
|
||||
if len(qryFltr.MinUsage) != 0 {
|
||||
minUsage, err := utils.ParseDurationWithNanosecs(qryFltr.MinUsage)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user