From 043e2a81c02cbce4762b4f2b057517d09f6f2a38 Mon Sep 17 00:00:00 2001 From: Mahayoga Date: Sat, 13 Jun 2026 20:56:00 +0700 Subject: [PATCH] WIP: Perbaikan validasi booking (belum mari) --- app/Http/Controllers/BookingController.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/BookingController.php b/app/Http/Controllers/BookingController.php index 7974427..d5ed088 100644 --- a/app/Http/Controllers/BookingController.php +++ b/app/Http/Controllers/BookingController.php @@ -19,7 +19,7 @@ public function getchData() { $data = BookingModel::get(); $data_ = $data->toArray(); foreach($data_ as $key => $value) { - if(time() > $value['unix_expired_time']) { + if(time() > $value['unix_expired_time'] && $value['status_tes'] != '2') { $data_session = TestSessionsModel::where('id_booking', $value['id_booking'])->first(); $data_booking = BookingModel::where('id_booking', $value['id_booking'])->first(); if($data_session != null) { @@ -166,8 +166,10 @@ public function update(Request $request, string $id) 'status_tes' => ['required'] ]); - BookingModel::where('id_booking', $id)->update([ - 'status_tes' => $request->status_tes + $data = BookingModel::where('id_booking', $id)->first(); + + $data->update([ + 'status_tes' => str($request->status_tes) ]); return response()->json([