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);
|
||||
|
||||
Reference in New Issue
Block a user