mirror of
https://github.com/tobiasehlert/teslamateapi.git
synced 2026-02-27 09:54:18 +08:00
Merge pull request #69 from tobiasehlert/bug-43
Remove charges and drives that have null on end_date
This commit is contained in:
@@ -106,7 +106,7 @@ func TeslaMateAPICarsChargesV1(c *gin.Context) {
|
||||
LEFT JOIN addresses address ON address_id = address.id
|
||||
LEFT JOIN positions position ON position_id = position.id
|
||||
LEFT JOIN geofences geofence ON geofence_id = geofence.id
|
||||
WHERE charging_processes.car_id=$1
|
||||
WHERE charging_processes.car_id=$1 AND charging_processes.end_date IS NOT NULL
|
||||
ORDER BY start_date DESC
|
||||
LIMIT $2 OFFSET $3;`
|
||||
rows, err := db.Query(query, CarID, ResultShow, ResultPage)
|
||||
|
||||
@@ -136,7 +136,7 @@ func TeslaMateAPICarsChargesDetailsV1(c *gin.Context) {
|
||||
LEFT JOIN positions position ON position_id = position.id
|
||||
LEFT JOIN geofences geofence ON geofence_id = geofence.id
|
||||
LEFT JOIN charges ON charging_processes.id = charges.id
|
||||
WHERE charging_processes.car_id=$1 AND charging_processes.id=$2
|
||||
WHERE charging_processes.car_id=$1 AND charging_processes.id=$2 AND charging_processes.end_date IS NOT NULL
|
||||
ORDER BY start_date DESC;`
|
||||
rows, err := db.Query(query, CarID, ChargeID)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user