Price tracking Changes

This commit is contained in:
Hickmeister
2025-01-14 22:49:09 +00:00
parent a08c4eba3b
commit 030d72c202
5 changed files with 178 additions and 130 deletions

View File

@@ -28,7 +28,7 @@ try {
ROW_NUMBER() OVER (PARTITION BY filamentId ORDER BY recordedAt DESC) as rn
FROM filamentPriceHistory
) ranked
WHERE rn <= 280
WHERE rn <= 380
) filtered ON fp.filamentId = filtered.filamentId AND fp.recordedAt = filtered.recordedAt
ORDER BY ft.filamentName, fp.recordedAt ASC
");
@@ -48,7 +48,7 @@ try {
'color' => $filament['color'],
'amazonUrl' => $filament['amazonUrl'],
'prices' => [],
'currentDiscount' => $filament['currentDiscount'] ?? 0 // Include the latest discount
'currentDiscount' => $filament['currentDiscount'] ? json_decode($filament['currentDiscount'], true) : null // Decode JSON format
];
}