added chinabankslip return on show booking query

updated upload po page with booking info, china bankslip and user bankslip
This commit is contained in:
Jack Goh
2018-06-29 17:40:28 +08:00
parent 7aba4e2b05
commit 3d05dbb755
4 changed files with 195 additions and 66 deletions
+6 -4
View File
@@ -134,9 +134,7 @@ class BookingController extends Controller
$booking = Booking::where('user_id',Auth::user()->id)->where('id', $id)->first();
// just added to try
$user_bankslip = $booking->userBankSlip()->first();
$china_bankslip = $booking->chinaBankSlip()->first();
if($booking){
@@ -148,6 +146,10 @@ class BookingController extends Controller
$date1 = new DateTime($user_bankslip->updated_at);
}
if($china_bankslip){
$booking->china_bankslip_path = Storage::url($china_bankslip->china_bank_slip_path);
}
$date2 = new DateTime();
$difference_in_seconds = ($date1->format('U') + 600) - ($date2->format('U'));
@@ -455,7 +457,7 @@ class BookingController extends Controller
return response()->json(['user_po_path'=> $user_po->image_path ],200);
}
return response()->json(['message'=> 'waiting customer to upload their po'],400);
return response()->json(['message'=> 'waiting customer to upload their po'], 200);
}
public function delete(Booking $book_id)