mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
better getlcr paginator
This commit is contained in:
@@ -1112,10 +1112,10 @@ func (cd *CallDescriptor) GetLCR(stats StatsInterface, p *utils.Paginator) (*LCR
|
||||
lcrCost.Sort()
|
||||
}
|
||||
if p != nil {
|
||||
if p.Offset != nil && *p.Offset > 0 && *p.Offset < len(lcrCost.SupplierCosts)-1 {
|
||||
if p.Offset != nil && *p.Offset > 0 && *p.Offset < len(lcrCost.SupplierCosts) {
|
||||
lcrCost.SupplierCosts = lcrCost.SupplierCosts[*p.Offset:]
|
||||
}
|
||||
if p.Limit != nil && *p.Limit > 0 && *p.Limit < len(lcrCost.SupplierCosts)-1 {
|
||||
if p.Limit != nil && *p.Limit > 0 && *p.Limit < len(lcrCost.SupplierCosts) {
|
||||
lcrCost.SupplierCosts = lcrCost.SupplierCosts[:*p.Limit]
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user