Merge pull request #10009 from inietov/fixes/blank_results_for_non_superadmins

Fixes #9985. Error 500 when using the asset search - blank results for non super-admins
This commit is contained in:
snipe 2021-08-30 13:29:18 -07:00 committed by GitHub
commit a02534b6c8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -78,7 +78,7 @@ final class Company extends SnipeModel
$company_id = null;
}
$table = ($table_name) ? $table_name."." : '';
$table = ($table_name) ? $table_name."." : $query->getModel()->getTable().".";
if(\Schema::hasColumn($query->getModel()->getTable(), $column)){
return $query->where($table.$column, '=', $company_id);