This commit is contained in:
2026-06-14 21:09:43 +03:30
parent 6f86e8242c
commit b84b2df01a
9 changed files with 287 additions and 66 deletions
+6 -4
View File
@@ -93,17 +93,17 @@ class ZaarboxPriceService
if ($this->config->getBool('chart_use_local_data', false)) {
$local = app(PriceSnapshotService::class)->chartFromDatabase();
if (! empty($local['DAILY'])) {
return $local;
return app(PriceSnapshotService::class)->sanitizeChartPrices($local);
}
}
$cached = Cache::get($this->cacheKey());
if (is_array($cached) && isset($cached['prices'])) {
return $cached['prices'];
return app(PriceSnapshotService::class)->sanitizeChartPrices($cached['prices']);
}
return $this->refreshCache();
return app(PriceSnapshotService::class)->sanitizeChartPrices($this->refreshCache());
}
/**
@@ -566,7 +566,9 @@ class ZaarboxPriceService
for ($bucket = $firstBucket; $bucket <= $endMs; $bucket += $intervalMs) {
while ($index < $count && $points[$index]['timestamp'] <= $bucket) {
$lastPoint = $points[$index];
if ($points[$index]['price'] > PriceSnapshotService::MIN_VALID_CHART_PRICE_RIAL) {
$lastPoint = $points[$index];
}
$index++;
}