mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange.git
synced 2026-08-19 04:14:04 +00:00
completed list booking
TBD implement status feature
This commit is contained in:
@@ -17,11 +17,28 @@ class BookingController extends Controller
|
||||
{
|
||||
|
||||
public function index(){
|
||||
$booking = Booking::select('bookings.id', 'rates.bookings.term')
|
||||
->leftJoin('rates', 'bookings.rate_id', '=', 'rates.id')
|
||||
$bookings = Booking::select('id', 'created_at', 'rate', 'amount', 'bia', 'verification_status')
|
||||
->where('user_id',Auth::user()->id)
|
||||
->get();
|
||||
return $booking;
|
||||
|
||||
// reformat to fit frontend structure
|
||||
foreach ($bookings as $booking) {
|
||||
// set timeout
|
||||
$date1 = new DateTime($booking->created_at);
|
||||
$date2 = new DateTime();
|
||||
$difference_in_seconds = ($date1->format('U') + 600) - ($date2->format('U'));
|
||||
$booking->timeout = $difference_in_seconds;
|
||||
|
||||
// TODO : transfer_amount change name to bia
|
||||
$booking->transfer_amount = $booking->bia;
|
||||
|
||||
// TODO : Logic for status
|
||||
$booking->track_status = "1/1";
|
||||
$booking->status_desc = "hello";
|
||||
$booking->status = 6;
|
||||
}
|
||||
|
||||
return $bookings;
|
||||
}
|
||||
|
||||
public function show($id)
|
||||
|
||||
Reference in New Issue
Block a user