zarbox added 8
This commit is contained in:
@@ -133,6 +133,7 @@ class WalletController extends Controller
|
|||||||
$this->applyProductTransactionTitle($record);
|
$this->applyProductTransactionTitle($record);
|
||||||
$this->applyProductOrderDisplayFields($record);
|
$this->applyProductOrderDisplayFields($record);
|
||||||
$this->applyProductTransactionUnit($record);
|
$this->applyProductTransactionUnit($record);
|
||||||
|
$this->applyTransactionDisplayStatus($record);
|
||||||
}
|
}
|
||||||
|
|
||||||
return response()->json($records);
|
return response()->json($records);
|
||||||
@@ -461,6 +462,20 @@ class WalletController extends Controller
|
|||||||
return !empty($record->wallet?->product);
|
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
|
private function resolveMainWalletBalanceCashForOrder($record): ?int
|
||||||
{
|
{
|
||||||
$customerId = $record->customer_id ?? auth('customer')->id();
|
$customerId = $record->customer_id ?? auth('customer')->id();
|
||||||
|
|||||||
Reference in New Issue
Block a user