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:
Jack Goh
2018-06-28 15:55:58 +08:00
9 changed files with 1035 additions and 726 deletions
+14 -6
View File
@@ -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();