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

This commit is contained in:
2026-05-02 02:03:42 +02:00
parent 58d0c18e25
commit 6cbf76918c
4 changed files with 195 additions and 50 deletions

View File

@@ -410,6 +410,23 @@ final class MiningRepository
return $this->normalizeRows($stmt->fetchAll() ?: []);
}
public function listRecentMeasurements(string $projectKey, int $limit = 200): array
{
$stmt = $this->pdo->prepare(
'SELECT * FROM ' . $this->table('measurements') . '
WHERE project_key = :project_key AND owner_sub = :owner_sub
ORDER BY measured_at DESC
LIMIT :limit'
);
$stmt->bindValue(':project_key', $projectKey, PDO::PARAM_STR);
$stmt->bindValue(':owner_sub', $this->ownerSub, PDO::PARAM_STR);
$stmt->bindValue(':limit', $limit, PDO::PARAM_INT);
$stmt->execute();
$rows = $this->normalizeRows($stmt->fetchAll() ?: []);
return array_reverse($rows);
}
public function listAllMeasurements(string $projectKey): array
{
$stmt = $this->pdo->prepare(