fix title

This commit is contained in:
2026-08-03 11:51:16 +03:30
parent ec0fd28efc
commit d360539208
14 changed files with 286 additions and 53 deletions
@@ -1512,9 +1512,11 @@ class ZarinController extends Controller
}
$data['handler'] = 'wallet';
$isDeposit = (int) ($data['direction'] ?? 0) === 0;
$sharh = self::accountingWalletDesc($isDeposit, $data['note'] ?? null);
$zarin = $existing ?? Zarin::create([
'customer_id' => $customer->id,
'desc' => $data['direction'] == 0 ? 'شارژ حساب' : 'برداشت از حساب',
'desc' => $sharh,
'amount' => $data['value'],
'type' => 'ريال',
'date' => Carbon::now(),
@@ -1545,7 +1547,7 @@ class ZarinController extends Controller
'meghdar' => $data['value'],
'fi' => $mazaneh,
'hesab' => $customer->moshtari_code,
'sharh' => $data['direction'] == 0 ? 'شارژ حساب' : 'برداشت از حساب',
'sharh' => $sharh,
'ayar' => '750',
'movaghat' => '',
'idFactor' => '',
@@ -1584,7 +1586,7 @@ class ZarinController extends Controller
/**
* پاداش معرفی — همیشه روی حساب معرف (نه کاربر تازه‌ثبت‌نام‌شده).
*/
public function referrerGoldReward(Customer $invitedCustomer, float $gold, string $desc = 'پاداش بابت معرفی')
public function referrerGoldReward(Customer $invitedCustomer, float $gold, string $desc = 'پاداش معرفی')
{
$referrer = $invitedCustomer->referrer();
if (!$referrer) {
@@ -1744,12 +1746,10 @@ class ZarinController extends Controller
$vazn = $mapper->accountingWeight($product, $rawValue, $data);
$isDeposit = (int) ($data['direction'] ?? 1) === 1;
$title = $mapper->productTitle($product);
$action = $isDeposit ? 'شارژ' : 'دشارژ';
$sharh = !empty($data['note'])
? (string) $data['note']
: (!empty($data['desc'])
? (string) $data['desc']
: trim($title !== '' ? "{$action} {$title}" : "{$action} {$mapper->kindLabel($mapper->resolveKind($product))}"));
$sharh = self::accountingWalletDesc(
$isDeposit,
!empty($data['note']) ? (string) $data['note'] : (!empty($data['desc']) ? (string) $data['desc'] : null)
);
$data['note'] = $sharh;
$data['handler'] = 'walletGold';
$syncAmount = $mapper->isCountDoc($product) ? $count : $vazn;