product time changed 3
This commit is contained in:
@@ -782,6 +782,9 @@ class WalletController extends Controller
|
||||
$row['type_str'] = 'برداشت طلایی';
|
||||
}
|
||||
|
||||
$this->normalizeApiRelationStsStr($row, 'order', Order::$STS);
|
||||
$this->normalizeApiRelationStsStr($row, 'withdraw', Withdraw::$STS);
|
||||
|
||||
$out[] = $row;
|
||||
}
|
||||
|
||||
@@ -868,4 +871,32 @@ class WalletController extends Controller
|
||||
return $previousTx ? (int) $previousTx->balance_cash : null;
|
||||
}
|
||||
|
||||
private function normalizeApiRelationStsStr(array &$row, string $key, array $stsMap): void
|
||||
{
|
||||
if (empty($row[$key]) || !is_array($row[$key])) {
|
||||
return;
|
||||
}
|
||||
|
||||
$relation = &$row[$key];
|
||||
$sts = $relation['sts'] ?? null;
|
||||
if ($sts === null && isset($relation['sts_str']) && is_numeric($relation['sts_str'])) {
|
||||
$sts = (int) $relation['sts_str'];
|
||||
}
|
||||
|
||||
if ($sts !== null && isset($stsMap[$sts])) {
|
||||
$relation['sts_str'] = $stsMap[$sts];
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$current = trim((string) ($relation['sts_str'] ?? ''));
|
||||
if ($current !== '' && $current !== 'بدون مقدار') {
|
||||
return;
|
||||
}
|
||||
|
||||
if ($key === 'order' && (int) ($relation['payment_sts'] ?? 0) === 4) {
|
||||
$relation['sts_str'] = 'موفق';
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user