mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange.git
synced 2026-08-19 12:24:09 +00:00
Merge branch 'master' of gitlab.com:CIEFWorldwideSdnBhd/exchange into integration/upload-invoice
# Conflicts: # database/migrations/2018_06_28_011717_rename_booking_foreignkey_in_po_table.php # database/seeds/DatabaseSeeder.php
This commit is contained in:
@@ -19,11 +19,13 @@ class BookingController extends Controller
|
||||
{
|
||||
|
||||
public function index(){
|
||||
$user = Auth::user();
|
||||
$user = Auth::user();
|
||||
$bookings = Booking::select('id', 'created_at', 'status', 'rate', 'term', 'amount', 'bia', 'verification_status')
|
||||
->where('user_id', $user->id)
|
||||
->get();
|
||||
|
||||
->where('user_id', $user->id)
|
||||
->get()
|
||||
->paginate(10);
|
||||
|
||||
|
||||
// reformat to fit frontend structure
|
||||
foreach ($bookings as $booking) {
|
||||
// set timeout
|
||||
@@ -133,6 +135,12 @@ class BookingController extends Controller
|
||||
public function show($id)
|
||||
{
|
||||
$booking = Booking::where('user_id',Auth::user()->id)->where('id', $id)->first();
|
||||
// just added to try
|
||||
$user_bankslip = $booking->userBankSlip()->first();
|
||||
|
||||
if ($user_bankslip){
|
||||
$booking->user_bankslip_path = Storage::url($user_bankslip->bankslip_path);
|
||||
}
|
||||
|
||||
if($booking){
|
||||
$date1 = new DateTime($booking->created_at);
|
||||
@@ -146,8 +154,8 @@ class BookingController extends Controller
|
||||
}
|
||||
return $booking;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function adminShow($id)
|
||||
{
|
||||
$booking = Booking::where('id', $id)->first();
|
||||
|
||||
Reference in New Issue
Block a user