added marking to bookings api

changed hard coded marking in booking details to dynamic for frontend
This commit is contained in:
Jack Goh
2018-07-07 16:15:32 +08:00
parent 71e11fa034
commit 538adc7366
13 changed files with 16 additions and 15 deletions
+4 -3
View File
@@ -169,6 +169,7 @@ class BookingController extends Controller
$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;
$booking->marking = $booking->user->marking;
if (!$booking){
return response()->json(['success'=>false, 'message'=>'not found'], 404);
@@ -214,6 +215,7 @@ class BookingController extends Controller
$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;
$booking->marking = $booking->user->marking;
if (!$booking){
return response()->json(['success'=>false, 'message'=>'not found'], 404);
@@ -524,6 +526,7 @@ class BookingController extends Controller
$term = $request->input('term');
$china_beneficiary = $request->input('china_beneficiary');
$rates = Rate::orderby('updated_at','desc')->first();
$marking = $user = Auth::user()->marking;
$creditLimit = SettingCredit::orderby('updated_at','desc')->first();
@@ -534,9 +537,7 @@ class BookingController extends Controller
if($amount > $creditLimit->rmb_credit_limit){
return response()->json(["message" => "Exceed credit limit, please contact our sales team for larger quantitiy"], 400);
}
// TODO : get marking
$marking = "123X";
switch ($term) {
case "x1_cash":