feat: landing settings, instant withdraw deduct, and OTP site URL
Add has_landing plus landing_* deploy keys, deduct balance on withdraw request, keep app_url for SMS login links, and clarify Zarin rial wallet document titles. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -235,7 +235,7 @@ class SettingsController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* تنظیمات پیشرفته: ۱۵ دسترسی از سوپرادمین + بقیهٔ can_edit=0 از DB لوکال.
|
||||
* تنظیمات پیشرفته: ۱۶ دسترسی از سوپرادمین + بقیهٔ can_edit=0 از DB لوکال.
|
||||
*/
|
||||
private function composeSystemSettings($localRows)
|
||||
{
|
||||
@@ -319,7 +319,7 @@ class SettingsController extends Controller
|
||||
/**
|
||||
* get_settings ادمین (و پایهٔ publicIndex قبل از فیلتر show_to_user):
|
||||
* can_edit=1 (+ runtime + local-owned) از DB لوکال
|
||||
* فقط ۱۵ دسترسی سوپرادمین از overlay؛ بقیهٔ can_edit=0 از کپی لوکال
|
||||
* فقط ۱۶ دسترسی سوپرادمین از overlay؛ بقیهٔ can_edit=0 از کپی لوکال
|
||||
* اگر سوپرادمین در دسترس نباشد کل جدول لوکال برمیگردد.
|
||||
*/
|
||||
private function composeGetSettings($localRows)
|
||||
|
||||
@@ -275,6 +275,9 @@ class WalletController extends Controller
|
||||
try {
|
||||
$data['direction'] = $deposit ? 0 : 1;
|
||||
$data['withdraw_id'] = $Withdraw->id;
|
||||
if (!$deposit && trim((string) ($data['note'] ?? '')) === '') {
|
||||
$data['note'] = 'برداشت وجه';
|
||||
}
|
||||
app(\App\Http\Controllers\Admin\ZarinController::class)->wallet($data);
|
||||
} catch (\Exception $e) {
|
||||
report($e);
|
||||
@@ -1446,6 +1449,10 @@ class WalletController extends Controller
|
||||
|
||||
$withdraw = Withdraw::findOrFail($request->id);
|
||||
$withdraw->update($data);
|
||||
|
||||
if ($withdraw->customer) {
|
||||
$this->broadcastCustomerWalletAssets($withdraw->customer);
|
||||
}
|
||||
// $tahesab = new TahesabController();
|
||||
// $tahesab->wallet([
|
||||
// 'customer_id' => $withdraw->customer_id,
|
||||
|
||||
@@ -1861,12 +1861,21 @@ class ZarinController extends Controller
|
||||
: ['korf' => 'k', 'parDar' => 1];
|
||||
}
|
||||
|
||||
/** شرح سند ریالی زرین — همیشه با واریز/برداشت شروع شود تا «خرید فی» دیده نشود */
|
||||
/**
|
||||
* شرح سند ریالی زرین — همیشه «واریز وجه» یا «برداشت وجه».
|
||||
* دشارژ ادمین و برداشت مشتری هر دو → «برداشت وجه» (پیشوند «واریز اینترنتی به» را زرین خودش میگذارد).
|
||||
*/
|
||||
private function zarinRialWalletSharh(bool $isDeposit, ?string $note): string
|
||||
{
|
||||
$base = $isDeposit ? 'واریز' : 'برداشت';
|
||||
$base = $isDeposit ? 'واریز وجه' : 'برداشت وجه';
|
||||
$normalized = self::accountingWalletDesc($isDeposit, $note);
|
||||
if ($normalized === '' || $normalized === $base) {
|
||||
$generic = [
|
||||
'', 'واریز', 'برداشت', 'واریز وجه', 'برداشت وجه',
|
||||
'واریز ریالی', 'برداشت ریالی',
|
||||
'شارژ', 'دشارژ', 'شارژ حساب', 'کسر',
|
||||
'واریز به کیف پول', 'برداشت از کیف پول', 'برداشت از حساب',
|
||||
];
|
||||
if (in_array($normalized, $generic, true) || in_array(trim((string) $note), $generic, true)) {
|
||||
return $base;
|
||||
}
|
||||
if (str_starts_with($normalized, $base)) {
|
||||
@@ -2029,7 +2038,7 @@ class ZarinController extends Controller
|
||||
$data = array_merge($data, [
|
||||
'customer_id' => $existing->customer_id,
|
||||
'value' => $existing->amount,
|
||||
'direction' => str_contains((string) $existing->desc, 'برداشت') ? 1 : 0,
|
||||
'direction' => $this->sync()->rialWalletDirectionFromDesc((string) $existing->desc),
|
||||
'withdraw_id' => $existing->withdraw_id,
|
||||
]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user