update add pool filter on vehicle trips report

This commit is contained in:
wayanrivan
2026-07-01 13:44:06 +07:00
parent c25d3dbab6
commit f44b798e5b
2 changed files with 98 additions and 81 deletions

View File

@ -25,10 +25,12 @@ class ReportsController extends Controller
$q = "SELECT id, nopol1 from t_vehicles WHERE dlt is null order by nopol1";
$vehicletype = DB::table('t_vehicles_cats')->where('is_active', 1)->get();
$listNopol = DB::select($q);
$listpool = DB::table('t_conf_pools')->where('is_active')->get();
$data = [
'listNopol' => $listNopol,
'vehicletype' => $vehicletype
'vehicletype' => $vehicletype,
'listpool' => $listpool
];
$log = [
@ -63,6 +65,7 @@ class ReportsController extends Controller
$to_date = $req->input('to_date') - Helper::TIMEFIX;
$vid = $req->input('vid');
$vt = $req->input('vt');
$poolcode = $req->input('poolcode');
// $from_date = 1756054800;
// $to_date = 1756745940;
@ -161,7 +164,8 @@ class ReportsController extends Controller
t.start BETWEEN ? AND ?
and if(? , t.id = ? , 1=1)
and if(? , vt.id = ? , 1=1)
", [$from_date, $to_date, $from_date, $to_date, $vid, $vid, $vt, $vt]);
and if(? , t.pool_code = ? , 1=1)
", [$from_date, $to_date, $from_date, $to_date, $vid, $vid, $vt, $vt, $poolcode, $poolcode]);
// // RETURN 1 - LIST
// if($req->type != 'report'){