fix(price): read last quote and daily extremes from the active provider
A stray montzar tick landed in the prices table, which stores no source, so the database_last fallback served a ~168M quote on a shop whose Zaarbox board was at ~217M. Last price and today's high/low now come from price_sync_logs filtered by price_provider, the database fallback no longer counts as today's price, and daily extremes reset when the provider changes. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -2,7 +2,6 @@
|
||||
|
||||
namespace App\Services;
|
||||
|
||||
use App\Models\Price;
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
|
||||
class LivePriceCacheService
|
||||
@@ -114,8 +113,7 @@ class LivePriceCacheService
|
||||
{
|
||||
$config = app(ConfigService::class);
|
||||
$display = app(ProductDisplayPriceService::class);
|
||||
$last = Price::orderByDesc('id')->first();
|
||||
$base = $last ? (float) $last->price : 0.0;
|
||||
$base = (float) $display->resolveHistoricalBasePrice();
|
||||
$provider = $config->priceProvider();
|
||||
|
||||
$montzarSource = 0;
|
||||
|
||||
Reference in New Issue
Block a user