Adds default values if the expiring alerts threshold is null

This commit is contained in:
Ivan Nieto Vivanco
2022-01-18 14:21:49 -06:00
parent 201b52baf8
commit 42d86bf57b
2 changed files with 5 additions and 2 deletions
+2 -1
View File
@@ -627,7 +627,8 @@ class License extends Depreciable
*/
public static function getExpiringLicenses($days = 60)
{
$days = (is_null($days)) ? 30 : $days;
return License::whereNotNull('expiration_date')
->whereNull('deleted_at')
->whereRaw(DB::raw('DATE_SUB(`expiration_date`,INTERVAL '.$days.' DAY) <= DATE(NOW()) '))