This commit is contained in:
Pringgosutono
2025-10-30 10:32:01 +07:00
parent 8b833e7295
commit 8fb9731a90
4 changed files with 18 additions and 7 deletions

View File

@ -248,7 +248,7 @@ class ReportsController extends Controller
$list = DB::select("SELECT
t.crt_d , t.latitude, t.longitude, t.speed,
tgta.fulladdress,
t.pre_milleage, t.vhc_milleage
t.pre_milleage, t.vhc_milleage, fuel_count
FROM
t_gps_tracks t
left join t_gps_tracks_address tgta on tgta.master_id = t.id
@ -280,6 +280,7 @@ class ReportsController extends Controller
$duration = "{$hours} hour" . ($hours > 1 ? 's' : '') . " {$minutes} minute" . ($minutes > 1 ? 's' : '');
$distance = $list[count($list) - 1]->vhc_milleage - $list[0]->vhc_milleage;
$fuel_consumed = $list[count($list) - 1]->fuel_count - $list[0]->fuel_count;
$data = [
'nopol1' => $nopol1,
@ -291,6 +292,7 @@ class ReportsController extends Controller
'finish' => $finish,
'duration' => $duration,
'distance' => $distance,
'fuel_consumed' => $fuel_consumed,
];
// dd($list);
return view('menu_v1.reports._trip_detail', $data);

View File

@ -324,7 +324,7 @@ class Tracks extends Model
tr_addr.state_text AS lst_state_text, tr_addr.city_text AS lst_city_text,
tr_addr.district_text AS lst_district_text, tr_addr.village_text AS lst_village_text,
tr_addr.postcode AS lst_postcode, tr_addr.streets AS lst_streets,
tr_addr.fulladdress AS lst_fulladdress";
tr_addr.fulladdress AS lst_fulladdress, tr.fuel_curr";
if (isset($filter["active_rates"])) {
$query .= ",