Fix select if using global limit
This commit is contained in:
parent
7d229ec25b
commit
4d3c6c7a13
|
@ -16,6 +16,7 @@ use Illuminate\Http\Client\Response;
|
||||||
use Illuminate\Http\RedirectResponse;
|
use Illuminate\Http\RedirectResponse;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Support\Facades\Auth;
|
use Illuminate\Support\Facades\Auth;
|
||||||
|
use Illuminate\Support\Facades\Log;
|
||||||
use Illuminate\Support\Facades\Request as FacadesRequest;
|
use Illuminate\Support\Facades\Request as FacadesRequest;
|
||||||
|
|
||||||
class ServerController extends Controller
|
class ServerController extends Controller
|
||||||
|
@ -98,7 +99,7 @@ class ServerController extends Controller
|
||||||
if (FacadesRequest::has("product_id")) {
|
if (FacadesRequest::has("product_id")) {
|
||||||
$product = Product::findOrFail(FacadesRequest::input("product_id"));
|
$product = Product::findOrFail(FacadesRequest::input("product_id"));
|
||||||
if (
|
if (
|
||||||
Auth::user()->credits <=
|
Auth::user()->credits <
|
||||||
($product->minimum_credits == -1
|
($product->minimum_credits == -1
|
||||||
? Configuration::getValueByKey('MINIMUM_REQUIRED_CREDITS_TO_MAKE_SERVER', 50)
|
? Configuration::getValueByKey('MINIMUM_REQUIRED_CREDITS_TO_MAKE_SERVER', 50)
|
||||||
: $product->minimum_credits)
|
: $product->minimum_credits)
|
||||||
|
|
|
@ -113,7 +113,8 @@
|
||||||
class="custom-select @error('product_id') is-invalid @enderror">
|
class="custom-select @error('product_id') is-invalid @enderror">
|
||||||
@foreach ($products as $product)
|
@foreach ($products as $product)
|
||||||
<option value="{{ $product->id }}" @if ($product->minimum_credits == -1 && Auth::user()->credits >= $minimum_credits)
|
<option value="{{ $product->id }}" @if ($product->minimum_credits == -1 && Auth::user()->credits >= $minimum_credits)
|
||||||
@elseif (Auth::user()->credits >= $product->minimum_credits)
|
@elseif ($product->minimum_credits != -1 && Auth::user()->credits >=
|
||||||
|
$product->minimum_credits)
|
||||||
@else
|
@else
|
||||||
disabled
|
disabled
|
||||||
@endif
|
@endif
|
||||||
|
|
Loading…
Reference in a new issue