This commit is contained in:
meusinfirmary
2025-07-23 04:44:20 +07:00
parent db6fe59062
commit 3e6ea0b3d4
9 changed files with 641 additions and 402 deletions

View File

@ -24,19 +24,11 @@ class TrackController extends Controller
$now = time();
$input = [];
$rulesInput = [];
// validasi input
// $isValidInput = Validator::make($input, $rulesInput);
// if (!$isValidInput->passes()) {
// $apiResp = Responses::bad_input($isValidInput->messages()->first());
// return new Response($apiResp, $apiResp['meta']['code']);
// }
$filter = [
"get_order_data" => 1,
];
if ($req->cptid) {
$filter["company"] = $req->cptid;
// $filter["company"] = 1;
}
if ($req->auth->is_tracking === Users::IS_TRACK_VHC_YES) {
@ -75,7 +67,6 @@ class TrackController extends Controller
$filter["vids"][] = $v->vhc_id;
}
} elseif ($req->auth->role === Users::ROLE_SPECIAL_TRACKING) {
// $filter['vid'] = 0;
$filter["company"] = $req->auth->client_group_id;
} else {
$filter["vid"] = 0;
@ -88,8 +79,7 @@ class TrackController extends Controller
// dd($list);
foreach ($list as $key => $row) {
$list[$key]->DT_RowIndex = $key + 1;
// $list[$key]->mileage_km = '-';
$list[$key]->track_schedule = $row->track_sch_h . "/" . $row->track_sch_d; // combine track_sch_h + track_sch_d
$list[$key]->is_track_holiday_text =
$list[$key]->is_track_holiday == Vehicles::ENABLED_TRACK_HOLIDAY ? "Enabled" : "Disabled";
$list[$key]->alert_zones = "-";