Fixed missing db prefix on scopeDueOrOverdueForAudit

This commit is contained in:
snipe 2020-06-23 02:41:59 -07:00
parent 7ccb41371e
commit 35b9cf4b70
No known key found for this signature in database
GPG key ID: 10BFFDA3ED34B5AC

View file

@ -878,7 +878,7 @@ class Asset extends Depreciable
$interval = $settings->audit_warning_days ?? 0;
return $query->whereNotNull('assets.next_audit_date')
->whereRaw("DATE_SUB(assets.next_audit_date, INTERVAL $interval DAY) <= '".Carbon::now()."'")
->whereRaw("DATE_SUB(".DB::getTablePrefix()."assets.next_audit_date, INTERVAL $interval DAY) <= '".Carbon::now()."'")
->where('assets.archived', '=', 0)
->NotArchived();
}