added some keys in code
This commit is contained in:
@@ -11,6 +11,7 @@ use App\Models\User;
|
||||
use App\Models\Withdraw;
|
||||
use App\Models\BankAccount;
|
||||
use App\Models\Price;
|
||||
use App\Models\Setting;
|
||||
use App\Http\Controllers\Admin\TahesabController;
|
||||
use App\Services\ZaarboxPriceService;
|
||||
use Illuminate\Http\Request;
|
||||
@@ -185,6 +186,15 @@ class WalletController extends Controller
|
||||
if ($data['value'] > $wallet->cash) {
|
||||
throw new UnprocessableEntityHttpException('مقدار برداشت بیشتر از موجودی است');
|
||||
}
|
||||
|
||||
$min_withdraw = Setting::where('is_active', 1)
|
||||
->where('key', 'min_withdraw')
|
||||
->first();
|
||||
|
||||
if ($min_withdraw && (int) $min_withdraw->value > $data['value']) {
|
||||
throw new UnprocessableEntityHttpException('حداقل مقدار برداشت ' . number_format((int) $min_withdraw->value) . ' ریال است');
|
||||
}
|
||||
|
||||
$Withdraw = Withdraw::create([
|
||||
'customer_id' => auth('customer')->id(),
|
||||
"cash" => $data['value'],
|
||||
|
||||
Reference in New Issue
Block a user