优化游戏实时对局页面样式
This commit is contained in:
@@ -86,7 +86,6 @@ class Record extends Backend
|
||||
|
||||
$rows = Db::name('game_record')
|
||||
->where('status', 5)
|
||||
->whereLike('void_reason', 'system_recover:%')
|
||||
->field(['id', 'period_no', 'void_reason', 'update_time'])
|
||||
->order('id', 'desc')
|
||||
->limit($limit)
|
||||
@@ -96,6 +95,8 @@ class Record extends Backend
|
||||
$list = [];
|
||||
foreach ($rows as $row) {
|
||||
$meta = $this->parseRecoverVoidReason(is_string($row['void_reason'] ?? null) ? $row['void_reason'] : '');
|
||||
$reason = is_string($row['void_reason'] ?? null) ? $row['void_reason'] : '';
|
||||
$isAutoRecover = $this->isSystemRecoverReason($reason);
|
||||
$list[] = [
|
||||
'id' => (int) ($row['id'] ?? 0),
|
||||
'period_no' => (string) ($row['period_no'] ?? ''),
|
||||
@@ -104,7 +105,8 @@ class Record extends Backend
|
||||
'refunded_order_count' => $meta['orders'],
|
||||
'refunded_total_amount' => $meta['amount'],
|
||||
'recovered_at' => (int) ($row['update_time'] ?? 0),
|
||||
'void_reason' => (string) ($row['void_reason'] ?? ''),
|
||||
'void_reason' => $reason,
|
||||
'is_auto_recover' => $isAutoRecover ? 1 : 0,
|
||||
];
|
||||
}
|
||||
|
||||
@@ -125,10 +127,13 @@ class Record extends Backend
|
||||
'orders' => 0,
|
||||
'amount' => '0.00',
|
||||
];
|
||||
if ($reason === '' || str_starts_with($reason, 'system_recover:') === false) {
|
||||
if (!$this->isSystemRecoverReason($reason)) {
|
||||
return $meta;
|
||||
}
|
||||
$payload = substr($reason, strlen('system_recover:'));
|
||||
if (!str_contains($payload, '=')) {
|
||||
return $meta;
|
||||
}
|
||||
$parts = explode('|', $payload);
|
||||
foreach ($parts as $part) {
|
||||
$item = trim($part);
|
||||
@@ -156,4 +161,9 @@ class Record extends Backend
|
||||
}
|
||||
return $meta;
|
||||
}
|
||||
|
||||
private function isSystemRecoverReason(string $reason): bool
|
||||
{
|
||||
return $reason !== '' && str_starts_with($reason, 'system_recover:');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user