From f7edf4e2d33c22a1410b45cbe9e2f50661edffa3 Mon Sep 17 00:00:00 2001 From: adonis Date: Sat, 18 Jul 2026 15:23:16 +0330 Subject: [PATCH] fix some bugs 2 --- .../Controllers/Customer/WalletController.php | 20 +++++++++++++++++-- .../Pargar/PargarInboundController.php | 1 + .../rooyesh/wallet/src/models/Transaction.php | 2 ++ 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/Customer/WalletController.php b/app/Http/Controllers/Customer/WalletController.php index 6127bad..9acc255 100644 --- a/app/Http/Controllers/Customer/WalletController.php +++ b/app/Http/Controllers/Customer/WalletController.php @@ -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; } diff --git a/app/Http/Controllers/Pargar/PargarInboundController.php b/app/Http/Controllers/Pargar/PargarInboundController.php index a5b5939..0418230 100644 --- a/app/Http/Controllers/Pargar/PargarInboundController.php +++ b/app/Http/Controllers/Pargar/PargarInboundController.php @@ -285,6 +285,7 @@ class PargarInboundController extends Controller new TransactionInterface($walletInterface, [ 'cash' => $rialDiff, 'gold' => $goldDiff, + 'title' => 'تعدیل مانده پرگار', 'expire_at' => now(), 'active' => true, 'start_at' => now(), diff --git a/packages/rooyesh/wallet/src/models/Transaction.php b/packages/rooyesh/wallet/src/models/Transaction.php index 977bb2e..db26ee1 100644 --- a/packages/rooyesh/wallet/src/models/Transaction.php +++ b/packages/rooyesh/wallet/src/models/Transaction.php @@ -27,6 +27,8 @@ class Transaction extends Model 8 => ' پاداش بابت معرفی', 9 => 'سود زیر مجموعه', 10 => 'برداشت طلایی', + 12 => 'برداشت وجه نقد', + 22 => 'تعدیل مانده پرگار', ]; /**