From 5864be88550f113939fe911ade7abc2b15553f8e Mon Sep 17 00:00:00 2001 From: adonis Date: Thu, 4 Jun 2026 18:53:06 +0330 Subject: [PATCH] zarbox added 8 --- .../Controllers/Customer/WalletController.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/app/Http/Controllers/Customer/WalletController.php b/app/Http/Controllers/Customer/WalletController.php index 4c83dc8..c41e2bb 100644 --- a/app/Http/Controllers/Customer/WalletController.php +++ b/app/Http/Controllers/Customer/WalletController.php @@ -133,6 +133,7 @@ class WalletController extends Controller $this->applyProductTransactionTitle($record); $this->applyProductOrderDisplayFields($record); $this->applyProductTransactionUnit($record); + $this->applyTransactionDisplayStatus($record); } return response()->json($records); @@ -461,6 +462,20 @@ class WalletController extends Controller return !empty($record->wallet?->product); } + /** + * برداشت API فروشگاه (RequestsController) withdraw_id ندارد — برای UI همان withdraw.sts_str. + */ + private function applyTransactionDisplayStatus($record): void + { + if (!empty($record->withdraw) || !empty($record->order)) { + return; + } + + if ((int) $record->type === 4 && empty($record->withdraw_id)) { + $record->setRelation('withdraw', (object) ['sts_str' => 'درخواست از فروشگاه']); + } + } + private function resolveMainWalletBalanceCashForOrder($record): ?int { $customerId = $record->customer_id ?? auth('customer')->id();