A free open source IT asset/license management system
removed redundancy with raw query
Godfrey Mea63049b4bd7
diff --git a/app/Models/Asset.php b/app/Models/Asset.phpindex 71e3c726fd..55db03d6df 100644--- a/app/Models/Asset.php+++ b/app/Models/Asset.php@@ -699,10 +699,10 @@ class Asset extends Depreciable->whereNotNull('warranty_months')->whereNotNull('purchase_date')->whereNull('deleted_at')- ->whereRaw(\DB::raw('DATE_ADD(`purchase_date`,INTERVAL `warranty_months` MONTH) <= DATE(NOW() + INTERVAL '+ ->whereRaw('DATE_ADD(`purchase_date`,INTERVAL `warranty_months` MONTH) <= DATE(NOW() + INTERVAL '. $days- . ' DAY) AND DATE_ADD(`purchase_date`, INTERVAL `warranty_months` MONTH) > NOW()'))- ->orderByRaw(\DB::raw('DATE_ADD(`purchase_date`,INTERVAL `warranty_months` MONTH)'))+ . ' DAY) AND DATE_ADD(`purchase_date`, INTERVAL `warranty_months` MONTH) > NOW()')+ ->orderByRaw('DATE_ADD(`purchase_date`,INTERVAL `warranty_months` MONTH)')->get();}