We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6134ca0 commit 50a5ee4Copy full SHA for 50a5ee4
app/Models/Asset.php
@@ -950,7 +950,10 @@ public static function getExpiringWarrantyOrEol($days = 30)
950
})->orWhere(function ($query) use ($days) {
951
$query->whereNotNull('purchase_date')
952
->whereNotNull('warranty_months')
953
- ->whereBetween('purchase_date', [Carbon::now(), Carbon::now()->addMonths('assets.warranty_months')->addDays($days)]);
+ ->whereRaw(
954
+ 'DATE_ADD(purchase_date, INTERVAL warranty_months MONTH) BETWEEN ? AND ?',
955
+ [now(), now()->addDays($days)]
956
+ );
957
});
958
})
959
->orderBy('asset_eol_date', 'ASC')
0 commit comments