41 lines
915 B
PHP
41 lines
915 B
PHP
<?php
|
|
namespace App\Services\SyS;
|
|
|
|
use Carbon;
|
|
use Request;
|
|
use App\Models\Booking;
|
|
use App\Models\TravelBooking;
|
|
use App\Services\BookingImport;
|
|
|
|
class ReImport
|
|
{
|
|
//content_links
|
|
public static function show()
|
|
{
|
|
|
|
$TravelBooking = TravelBooking::orderBy('id', 'DESC')->limit(200)->get();
|
|
$data = [
|
|
'values' => $TravelBooking,
|
|
'text' => '',
|
|
];
|
|
|
|
return view('sys.tools.reimport', $data);
|
|
|
|
}
|
|
|
|
public static function store()
|
|
{
|
|
$data = Request::all();
|
|
$ret = "";
|
|
if(strpos($data['action'], 'checkOne_') !== false){
|
|
$id = (int) str_replace('checkOne_', '', $data['action']);
|
|
$travel_booking = TravelBooking::findOrFail($id);
|
|
|
|
$booking = BookingImport::importFrom($travel_booking);
|
|
|
|
dd($booking);
|
|
}
|
|
\Session()->flash('alert-success', $ret);
|
|
return back();
|
|
}
|
|
}
|