dcdsf
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user