mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange.git
synced 2026-08-21 13:24:27 +00:00
updated admin booking show function with user, china, po, invoice slip
removed one step from admin tracking integrated admin booking complete changed admin complete order component name
This commit is contained in:
@@ -95,7 +95,7 @@ class BookingController extends Controller
|
||||
// TODO : transfer_amount change name to bia
|
||||
$booking->transfer_amount = $booking->bia;
|
||||
|
||||
$booking->track_status = "(". $booking->admin_status ."/8)";
|
||||
$booking->track_status = "(". $booking->admin_status ."/7)";
|
||||
switch ($booking->admin_status) {
|
||||
case 1:
|
||||
$status_desc = "Waiting customer upload bank slip";
|
||||
@@ -132,7 +132,7 @@ 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();
|
||||
$china_bankslip = $booking->chinaBankSlip()->first();
|
||||
$po = $booking->purchaseOrder()->first();
|
||||
@@ -175,21 +175,44 @@ class BookingController extends Controller
|
||||
|
||||
public function adminShow($id)
|
||||
{
|
||||
$booking = Booking::where('id', $id)->first();
|
||||
$user_bankslip_path = $booking->userBankSlip()->first()->bankslip_path;
|
||||
$booking->user_bankslip_path = Storage::url($user_bankslip_path);
|
||||
$booking = Booking::where('id', $id)->firstOrFail();
|
||||
|
||||
|
||||
$user_bankslip = $booking->userBankSlip()->first();
|
||||
$china_bankslip = $booking->chinaBankSlip()->first();
|
||||
$po = $booking->purchaseOrder()->first();
|
||||
$invoice = $booking->invoice()->first();
|
||||
|
||||
if($booking){
|
||||
$date1 = new DateTime($booking->created_at);
|
||||
$date2 = new DateTime();
|
||||
$difference_in_seconds = ($date1->format('U') + 600) - ($date2->format('U'));
|
||||
|
||||
$booking->timeout = $difference_in_seconds;
|
||||
if ($user_bankslip){
|
||||
$booking->user_bankslip_path = Storage::url($user_bankslip->bankslip_path);
|
||||
$booking->reject_reason = $user_bankslip->reject_reason;
|
||||
$date1 = new DateTime($user_bankslip->updated_at);
|
||||
}
|
||||
|
||||
if (!$booking){
|
||||
return response()->json(['success'=>false, 'message'=>'not found'], 404);
|
||||
}
|
||||
return $booking;
|
||||
if($china_bankslip){
|
||||
$booking->china_bankslip_path = Storage::url($china_bankslip->china_bank_slip_path);
|
||||
}
|
||||
|
||||
if($po){
|
||||
$booking->user_po_path = Storage::url($po->image_path);
|
||||
}
|
||||
|
||||
if($invoice){
|
||||
$booking->invoice_path = Storage::url($invoice->invoice_path);
|
||||
}
|
||||
|
||||
$date1 = new DateTime($booking->created_at);
|
||||
$date2 = new DateTime();
|
||||
$difference_in_seconds = ($date1->format('U') + 600) - ($date2->format('U'));
|
||||
|
||||
$booking->timeout = $difference_in_seconds;
|
||||
|
||||
if (!$booking){
|
||||
return response()->json(['success'=>false, 'message'=>'not found'], 404);
|
||||
}
|
||||
return $booking;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user