From ea63049b4bd74aca0ac8be98ddf0919977716349 Mon Sep 17 00:00:00 2001 From: Godfrey M Date: Mon, 29 Aug 2022 12:33:51 -0700 Subject: [PATCH] removed redundancy with raw query --- app/Models/Asset.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Models/Asset.php b/app/Models/Asset.php index 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(); }