zarbox added 8

This commit is contained in:
2026-06-04 18:53:06 +03:30
parent a9f468c51b
commit 5864be8855
@@ -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();