Price tracking Changes
This commit is contained in:
@@ -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
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user