bug fixes
This commit is contained in:
@@ -1284,6 +1284,9 @@ final class Router
|
|||||||
'row_count' => count($rows),
|
'row_count' => count($rows),
|
||||||
'limit' => self::BOOTSTRAP_MEASUREMENT_LIMIT,
|
'limit' => self::BOOTSTRAP_MEASUREMENT_LIMIT,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
$rows = $this->ensureMeasurementFxReferences($projectKey, $rows, $settings);
|
||||||
|
|
||||||
return $this->analytics()->enrichMeasurements($rows, $settings, [
|
return $this->analytics()->enrichMeasurements($rows, $settings, [
|
||||||
'full_latest_only' => in_array($view, ['overview', 'mining'], true),
|
'full_latest_only' => in_array($view, ['overview', 'mining'], true),
|
||||||
]);
|
]);
|
||||||
|
|||||||
@@ -133,7 +133,18 @@ final class MiningRepository
|
|||||||
'SELECT * FROM ' . $this->table('cost_plans') . ' WHERE project_key = :project_key AND owner_sub = :owner_sub ORDER BY starts_at DESC, id DESC'
|
'SELECT * FROM ' . $this->table('cost_plans') . ' WHERE project_key = :project_key AND owner_sub = :owner_sub ORDER BY starts_at DESC, id DESC'
|
||||||
);
|
);
|
||||||
$stmt->execute(['project_key' => $projectKey, 'owner_sub' => $this->ownerSub]);
|
$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 cost plan rows may exist without a user scope assignment.
|
||||||
|
$legacyStmt = $this->pdo->prepare(
|
||||||
|
'SELECT * FROM ' . $this->table('cost_plans') . ' WHERE project_key = :project_key ORDER BY starts_at DESC, id DESC'
|
||||||
|
);
|
||||||
|
$legacyStmt->execute(['project_key' => $projectKey]);
|
||||||
|
|
||||||
|
return $this->normalizeRows($legacyStmt->fetchAll() ?: []);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function saveCostPlan(string $projectKey, array $payload): array
|
public function saveCostPlan(string $projectKey, array $payload): array
|
||||||
@@ -793,7 +804,18 @@ final class MiningRepository
|
|||||||
'SELECT * FROM ' . $this->table('purchased_miners') . ' WHERE project_key = :project_key AND owner_sub = :owner_sub ORDER BY purchased_at DESC, id DESC'
|
'SELECT * FROM ' . $this->table('purchased_miners') . ' WHERE project_key = :project_key AND owner_sub = :owner_sub ORDER BY purchased_at DESC, id DESC'
|
||||||
);
|
);
|
||||||
$stmt->execute(['project_key' => $projectKey, 'owner_sub' => $this->ownerSub]);
|
$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 purchased miner rows may exist without a user scope assignment.
|
||||||
|
$legacyStmt = $this->pdo->prepare(
|
||||||
|
'SELECT * FROM ' . $this->table('purchased_miners') . ' WHERE project_key = :project_key ORDER BY purchased_at DESC, id DESC'
|
||||||
|
);
|
||||||
|
$legacyStmt->execute(['project_key' => $projectKey]);
|
||||||
|
|
||||||
|
return $this->normalizeRows($legacyStmt->fetchAll() ?: []);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getPurchasedMiner(string $projectKey, int $minerId): ?array
|
public function getPurchasedMiner(string $projectKey, int $minerId): ?array
|
||||||
|
|||||||
Reference in New Issue
Block a user