fix bug
This commit is contained in:
@@ -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++;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user