Compare commits
1 Commits
version-bu
...
mileage_on
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
20a1421576 |
@@ -1,6 +1,7 @@
|
|||||||
package service
|
package service
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"sort"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/akhilrex/hammond/db"
|
"github.com/akhilrex/hammond/db"
|
||||||
@@ -15,6 +16,9 @@ func GetMileageByVehicleId(vehicleId string, since time.Time) (mileage []models.
|
|||||||
|
|
||||||
fillups := make([]db.Fillup, len(*data))
|
fillups := make([]db.Fillup, len(*data))
|
||||||
copy(fillups, *data)
|
copy(fillups, *data)
|
||||||
|
sort.Slice(fillups, func(i, j int) bool {
|
||||||
|
return fillups[i].OdoReading > fillups[j].OdoReading
|
||||||
|
})
|
||||||
|
|
||||||
var mileages []models.MileageModel
|
var mileages []models.MileageModel
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user