dcdsf
All checks were successful
Deploy / deploy-staging (push) Successful in 24s
Deploy / deploy-production (push) Has been skipped

This commit is contained in:
2026-06-22 00:17:40 +02:00
parent 650a0bd11a
commit 9ee43ba7d2
2 changed files with 51 additions and 6 deletions

View File

@@ -395,7 +395,18 @@ final class MiningRepository
'SELECT * FROM ' . $this->table('payouts') . ' WHERE project_key = :project_key AND owner_sub = :owner_sub ORDER BY payout_at ASC, id ASC'
);
$stmt->execute(['project_key' => $projectKey, 'owner_sub' => $this->ownerSub]);
return $this->normalizeRows($stmt->fetchAll() ?: []);
$rows = $this->normalizeRows($stmt->fetchAll() ?: []);
if ($rows !== []) {
return $rows;
}
// Legacy fallback: older payout rows may exist without a user scope assignment.
$legacyStmt = $this->pdo->prepare(
'SELECT * FROM ' . $this->table('payouts') . ' WHERE project_key = :project_key ORDER BY payout_at ASC, id ASC'
);
$legacyStmt->execute(['project_key' => $projectKey]);
return $this->normalizeRows($legacyStmt->fetchAll() ?: []);
}
public function savePayout(string $projectKey, array $payload): array