mirror of
https://gitlab.com/omair-personal/exchange.git
synced 2026-08-22 14:04:21 +00:00
added credit limit seeder, it causes error when creating booking
This commit is contained in:
@@ -165,7 +165,12 @@ class BookingController extends Controller
|
||||
$rates = Rate::orderby('updated_at','desc')->first();
|
||||
$term = $request->input('term');
|
||||
$amount = $request->input("amount"); // in RMB
|
||||
$creditLimit = SettingCredit::orderby('updated_at','desc')->first();
|
||||
$creditLimit = SettingCredit::orderby('updated_at','desc')->first();
|
||||
|
||||
if (!$creditLimit){
|
||||
return response()->json("Credit limit not set, please contact admin", 405);
|
||||
}
|
||||
|
||||
if($amount > $creditLimit->rmb_credit_limit){
|
||||
return response()->json("Exceed credit limit, need approved from admin", 401);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user