fix(stats): project trusted mileage source endpoint from metadata
This commit is contained in:
@@ -192,7 +192,7 @@ SELECT
|
||||
s.latest_total_mileage_km,
|
||||
s.source_key,
|
||||
s.phone,
|
||||
s.source_endpoint,
|
||||
COALESCE(NULLIF(ds.latest_source_endpoint, ''), s.source_endpoint),
|
||||
s.sample_count
|
||||
FROM vehicle_daily_mileage_source s
|
||||
LEFT JOIN vehicle_data_source ds
|
||||
@@ -200,7 +200,7 @@ LEFT JOIN vehicle_data_source ds
|
||||
WHERE s.vin = ?
|
||||
AND s.stat_date = ?
|
||||
AND s.protocol = ?
|
||||
AND s.quality_status = 'OK'
|
||||
AND s.quality_status = '` + QualityOK + `'
|
||||
AND s.daily_mileage_km BETWEEN 0 AND ?
|
||||
AND COALESCE(ds.enabled, 1) = 1
|
||||
ORDER BY COALESCE(ds.trust_priority, 100),
|
||||
|
||||
Reference in New Issue
Block a user