fix some bugs 2

This commit is contained in:
2026-07-18 15:23:16 +03:30
parent 8b1983e0f8
commit f7edf4e2d3
3 changed files with 21 additions and 2 deletions
@@ -172,7 +172,13 @@ class WalletController extends Controller
$record->title = $record->type_str;
$record->unit = "گرم";
if (isset($record->wallet)) {
if ((int) ($record->type ?? 0) === 22) {
$record->title = 'تعدیل مانده پرگار';
$record->unit = 'گرم';
} elseif ((int) ($record->type ?? 0) === 12) {
$record->title = 'برداشت وجه نقد';
$record->unit = 'ریال';
} elseif (isset($record->wallet)) {
$wallet = Wallet::with('product')->where('id', $record->wallet)->first();
if (isset($wallet->product)) {
@@ -192,7 +198,9 @@ class WalletController extends Controller
$record->title = $record->type_str;
}
$record->save();
if (!empty($record->title) && $record->title !== 'تعریف نشده') {
$record->save();
}
}
$this->applyAbshodeProductTransactionTitle($record);
@@ -785,6 +793,14 @@ class WalletController extends Controller
return self::mainMetalWithdrawTitle();
}
if ((int) $record->type === 12) {
return 'برداشت وجه نقد';
}
if ((int) $record->type === 22) {
return 'تعدیل مانده پرگار';
}
return $record->type_str;
}
@@ -285,6 +285,7 @@ class PargarInboundController extends Controller
new TransactionInterface($walletInterface, [
'cash' => $rialDiff,
'gold' => $goldDiff,
'title' => 'تعدیل مانده پرگار',
'expire_at' => now(),
'active' => true,
'start_at' => now(),
@@ -27,6 +27,8 @@ class Transaction extends Model
8 => ' پاداش بابت معرفی',
9 => 'سود زیر مجموعه',
10 => 'برداشت طلایی',
12 => 'برداشت وجه نقد',
22 => 'تعدیل مانده پرگار',
];
/**