fix some bugs
This commit is contained in:
@@ -135,6 +135,16 @@ class WalletController extends Controller
|
||||
$message = 'کیف پول شما به مبلغ ' . self::formatSmsRialAmount($data['value']) . " ریال در تاریخ " . verta()->format('Y/n/j H:i:s') . " شارژ شد " . "\n"
|
||||
. $this->Config('name_fa');
|
||||
$this->Send($customer->mobile, $message);
|
||||
try {
|
||||
app(\App\Services\CustomerAppNotifyService::class)->notifyCustomer(
|
||||
(int) $customer->id,
|
||||
'واریز به کیف پول',
|
||||
'کیف پول شما به مبلغ ' . self::formatSmsRialAmount($data['value']) . ' ریال شارژ شد.',
|
||||
'success'
|
||||
);
|
||||
} catch (\Throwable $e) {
|
||||
report($e);
|
||||
}
|
||||
return response()->json(true);
|
||||
}
|
||||
|
||||
@@ -232,6 +242,21 @@ class WalletController extends Controller
|
||||
. $this->Config('name_fa');
|
||||
$this->Send($customer->mobile, $message);
|
||||
}
|
||||
|
||||
try {
|
||||
$isDeposit = (float) $data['value'] > 0;
|
||||
app(\App\Services\CustomerAppNotifyService::class)->notifyCustomer(
|
||||
(int) $customer->id,
|
||||
$isDeposit ? 'واریز به کیف پول' : 'برداشت از کیف پول',
|
||||
'کیف پول شما به اندازه ' . self::formatSmsRialAmount($data['value']) . ' ریال'
|
||||
. ($isDeposit ? ' شارژ شد.' : ' کسر شد.')
|
||||
. (trim((string) ($data['note'] ?? '')) !== '' ? "\n" . $data['note'] : ''),
|
||||
$isDeposit ? 'success' : 'warning'
|
||||
);
|
||||
} catch (\Throwable $e) {
|
||||
report($e);
|
||||
}
|
||||
|
||||
$this->broadcastCustomerWalletAssets($customer);
|
||||
|
||||
return response()->json(true);
|
||||
@@ -339,6 +364,19 @@ class WalletController extends Controller
|
||||
. $this->Config('name_fa');
|
||||
$this->Send($customer->mobile, $message);
|
||||
}
|
||||
try {
|
||||
$isDeposit = (float) $data['value'] > 0;
|
||||
$weightUnit = self::tradeWeightUnit();
|
||||
app(\App\Services\CustomerAppNotifyService::class)->notifyCustomer(
|
||||
(int) $customer->id,
|
||||
$isDeposit ? 'واریز طلا' : 'برداشت طلا',
|
||||
'کیف پول شما به اندازه ' . self::formatSmsGoldWeight($data['value']) . " {$weightUnit}"
|
||||
. ($isDeposit ? ' شارژ شد.' : ' کسر شد.'),
|
||||
$isDeposit ? 'success' : 'warning'
|
||||
);
|
||||
} catch (\Throwable $e) {
|
||||
report($e);
|
||||
}
|
||||
$this->broadcastCustomerWalletAssets($customer);
|
||||
|
||||
return response()->json(true);
|
||||
@@ -517,6 +555,18 @@ class WalletController extends Controller
|
||||
. $this->Config('name_fa');
|
||||
$this->Send($customer->mobile, $message);
|
||||
}
|
||||
try {
|
||||
$isDeposit = (bool) $deposit;
|
||||
app(\App\Services\CustomerAppNotifyService::class)->notifyCustomer(
|
||||
(int) $customer->id,
|
||||
$isDeposit ? 'واریز محصول' : 'برداشت محصول',
|
||||
'کیف پول شما به اندازه ' . $formatted . ' ' . $unitLabel
|
||||
. ($isDeposit ? ' شارژ شد.' : ' کسر شد.'),
|
||||
$isDeposit ? 'success' : 'warning'
|
||||
);
|
||||
} catch (\Throwable $e) {
|
||||
report($e);
|
||||
}
|
||||
$this->broadcastCustomerWalletAssets($customer);
|
||||
|
||||
return response()->json(true);
|
||||
|
||||
@@ -453,6 +453,17 @@ class WalletController extends Controller
|
||||
}
|
||||
});
|
||||
|
||||
try {
|
||||
app(\App\Services\CustomerAppNotifyService::class)->notifyCustomer(
|
||||
(int) $customer->id,
|
||||
'درخواست برداشت',
|
||||
'درخواست برداشت مبلغ ' . number_format((float) $withdrawAmount) . ' ریال ثبت شد.',
|
||||
'info'
|
||||
);
|
||||
} catch (\Throwable $e) {
|
||||
report($e);
|
||||
}
|
||||
|
||||
return response()->json($Withdraw);
|
||||
}
|
||||
|
||||
|
||||
@@ -228,7 +228,16 @@ class FinanceController extends Controller
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
try {
|
||||
app(\App\Services\CustomerAppNotifyService::class)->notifyCustomer(
|
||||
(int) $Withdraw->customer_id,
|
||||
'واریز به کیف پول',
|
||||
'حساب شما به مقدار ' . number_format((float) $chargedAmount) . ' ریال شارژ شد.',
|
||||
'success'
|
||||
);
|
||||
} catch (\Throwable $e) {
|
||||
report($e);
|
||||
}
|
||||
|
||||
return view('showTransactionReport', compact('Withdraw'));
|
||||
return redirect('https://app.gholaktala.ir/transactions');
|
||||
|
||||
@@ -891,6 +891,17 @@ class SingleOrderController extends Controller
|
||||
if (self::isSmsNotifEnabled('sms_notif_order_customer')) {
|
||||
$this->send($customer->mobile, $customerMessage);
|
||||
}
|
||||
|
||||
try {
|
||||
app(\App\Services\CustomerAppNotifyService::class)->notifyCustomer(
|
||||
(int) $customer->id,
|
||||
$transactionType . ' ' . $subjectTitle,
|
||||
"گرم: {$amount}\nمبلغ کل: " . number_format((float) $totalPrice) . " ریال",
|
||||
'success'
|
||||
);
|
||||
} catch (\Throwable $e) {
|
||||
report($e);
|
||||
}
|
||||
}
|
||||
|
||||
private function assertProviderOrderAccepted(array &$data): void
|
||||
|
||||
@@ -219,6 +219,21 @@ class RequestsController extends Controller
|
||||
if (self::isSmsNotifEnabled('sms_notif_fund_withdraw_customer')) {
|
||||
$this->send($customer->mobile, $customerMessage);
|
||||
}
|
||||
|
||||
try {
|
||||
$title = ($data['method'] ?? '') === 'gold' ? 'برداشت طلایی' : 'برداشت ریالی';
|
||||
$body = ($data['method'] ?? '') === 'gold'
|
||||
? 'گرم: ' . ($data['amount'] ?? '') . "\nمبلغ کل: " . number_format((float) ($data['total_price'] ?? 0)) . ' ریال'
|
||||
: 'مبلغ: ' . number_format((float) ($data['amount'] ?? 0)) . ' ریال';
|
||||
app(\App\Services\CustomerAppNotifyService::class)->notifyCustomer(
|
||||
(int) $customer->id,
|
||||
$title,
|
||||
$body,
|
||||
'info'
|
||||
);
|
||||
} catch (\Throwable $e) {
|
||||
report($e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -206,6 +206,17 @@ class paypingController extends Controller
|
||||
}
|
||||
});
|
||||
|
||||
try {
|
||||
app(\App\Services\CustomerAppNotifyService::class)->notifyCustomer(
|
||||
(int) $Withdraw->customer_id,
|
||||
'واریز به کیف پول',
|
||||
'حساب شما به مقدار ' . number_format((float) $Withdraw->cash) . ' ریال شارژ شد.',
|
||||
'success'
|
||||
);
|
||||
} catch (\Throwable $e) {
|
||||
report($e);
|
||||
}
|
||||
|
||||
return view('showTransactionReport', compact('Withdraw', 'site_url'));
|
||||
}
|
||||
|
||||
@@ -297,6 +308,17 @@ class paypingController extends Controller
|
||||
}
|
||||
});
|
||||
|
||||
try {
|
||||
app(\App\Services\CustomerAppNotifyService::class)->notifyCustomer(
|
||||
(int) $Withdraw->customer_id,
|
||||
'واریز به کیف پول',
|
||||
'حساب شما به مقدار ' . number_format((float) $Withdraw->cash) . ' ریال شارژ شد.',
|
||||
'success'
|
||||
);
|
||||
} catch (\Throwable $e) {
|
||||
report($e);
|
||||
}
|
||||
|
||||
return view('showTransactionReport', compact('Withdraw', 'site_url'));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user