mirror of
https://gitlab.com/omair-personal/exchange.git
synced 2026-08-19 12:34:13 +00:00
added status tracking in booking
This commit is contained in:
@@ -17,7 +17,7 @@ class BookingController extends Controller
|
||||
{
|
||||
|
||||
public function index(){
|
||||
$bookings = Booking::select('id', 'created_at', 'rate', 'amount', 'bia', 'verification_status')
|
||||
$bookings = Booking::select('id', 'created_at', 'status', 'rate', 'amount', 'bia', 'verification_status')
|
||||
->where('user_id',Auth::user()->id)
|
||||
->get();
|
||||
|
||||
@@ -29,13 +29,32 @@ class BookingController extends Controller
|
||||
$difference_in_seconds = ($date1->format('U') + 600) - ($date2->format('U'));
|
||||
$booking->timeout = $difference_in_seconds;
|
||||
|
||||
// TODO : you can make it better
|
||||
if($difference_in_seconds < 0 ){
|
||||
$booking->timeout = 0;
|
||||
}
|
||||
|
||||
// TODO : transfer_amount change name to bia
|
||||
$booking->transfer_amount = $booking->bia;
|
||||
|
||||
$booking->track_status = "(". $booking->status ."/6)";
|
||||
|
||||
// TODO : Logic for status
|
||||
$booking->track_status = "1/1";
|
||||
$booking->status_desc = "hello";
|
||||
$booking->status = 6;
|
||||
switch ($booking->status) {
|
||||
case 1:
|
||||
$booking->status_desc = "Order in progress";
|
||||
case 2:
|
||||
$booking->status_desc = "Waiting for payment";
|
||||
case 3:
|
||||
$booking->status_desc = "Waiting verification";
|
||||
case 4:
|
||||
$booking->status_desc = "Processing transfer";
|
||||
case 5:
|
||||
$booking->status_desc = "Transfer Complete, please upload your PO";
|
||||
case 6:
|
||||
$booking->status_desc = "Processing invoice";
|
||||
default:
|
||||
$booking->status_desc = "";
|
||||
}
|
||||
}
|
||||
|
||||
return $bookings;
|
||||
|
||||
Reference in New Issue
Block a user