mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange.git
synced 2026-08-22 13:54:17 +00:00
fix wrong timeout
fix seeder info to newer info
This commit is contained in:
@@ -30,8 +30,9 @@ class BookingController extends Controller
|
||||
// set timeout
|
||||
$date1 = new DateTime($booking->created_at);
|
||||
$date2 = new DateTime();
|
||||
$difference_in_seconds = ($date1->format('U') + 600) - ($date2->format('U'));
|
||||
$booking->timeout = $difference_in_seconds;
|
||||
$time_in_seconds = SettingCredit::orderby('updated_at','desc')->first()->time_limit;
|
||||
$difference_in_seconds = ($date1->format('U') + $time_in_seconds) - ($date2->format('U'));
|
||||
$booking->timeout = $difference_in_seconds;
|
||||
|
||||
// TODO : you can make it better
|
||||
if($difference_in_seconds < 0 ){
|
||||
@@ -160,10 +161,12 @@ class BookingController extends Controller
|
||||
$booking->invoice_path = Storage::url($invoice->invoice_path);
|
||||
}
|
||||
|
||||
// set timeout
|
||||
$date1 = new DateTime($booking->created_at);
|
||||
$date2 = new DateTime();
|
||||
$difference_in_seconds = ($date1->format('U') + 600) - ($date2->format('U'));
|
||||
|
||||
$booking->timeout = $difference_in_seconds;
|
||||
$time_in_seconds = SettingCredit::orderby('updated_at','desc')->first()->time_limit;
|
||||
$difference_in_seconds = ($date1->format('U') + $time_in_seconds) - ($date2->format('U'));
|
||||
$booking->timeout = $difference_in_seconds;
|
||||
|
||||
if (!$booking){
|
||||
return response()->json(['success'=>false, 'message'=>'not found'], 404);
|
||||
@@ -203,11 +206,12 @@ class BookingController extends Controller
|
||||
$booking->invoice_path = Storage::url($invoice->invoice_path);
|
||||
}
|
||||
|
||||
// set timeout
|
||||
$date1 = new DateTime($booking->created_at);
|
||||
$date2 = new DateTime();
|
||||
$difference_in_seconds = ($date1->format('U') + 600) - ($date2->format('U'));
|
||||
|
||||
$booking->timeout = $difference_in_seconds;
|
||||
$time_in_seconds = SettingCredit::orderby('updated_at','desc')->first()->time_limit;
|
||||
$difference_in_seconds = ($date1->format('U') + $time_in_seconds) - ($date2->format('U'));
|
||||
$booking->timeout = $difference_in_seconds;
|
||||
|
||||
if (!$booking){
|
||||
return response()->json(['success'=>false, 'message'=>'not found'], 404);
|
||||
|
||||
@@ -27,10 +27,15 @@ class BookTableSeeder extends Seeder
|
||||
'bank_address' => 'cyber',
|
||||
'swift_code' => 'qwe123',
|
||||
'cnap' => '123asd',
|
||||
'term' => 'x1',
|
||||
'amount' => 1.2,
|
||||
'term' => 'x1_cash',
|
||||
'amount' => 200,
|
||||
'rmb_book_amount' => 200,
|
||||
'bia' => 189,
|
||||
'rate' => 1.2,
|
||||
'rate_id' => $rate->id,
|
||||
'user_id' => $user->id,
|
||||
'status' => 2,
|
||||
'admin_status' => 1,
|
||||
'created_at' => Carbon::now()->format('Y-m-d H:i:s'),
|
||||
'updated_at' => Carbon::now()->format('Y-m-d H:i:s'),
|
||||
]);
|
||||
|
||||
@@ -15,7 +15,7 @@ class SettingCreditSeeder extends Seeder
|
||||
DB::table('setting_credits')->insert([
|
||||
'rmb_credit_limit' => '4000',
|
||||
'usd_credit_limit' => '5000',
|
||||
'time_limit' => '600'
|
||||
'time_limit' => '6000'
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user