function applyFilters($q, $au)
{
-
- $this->selectAdd("i18n_translate('c' , Companies.country, 'en') as country_display_name ");
+ $tn = $this->tableName();
+ $this->selectAdd("i18n_translate('c' , {$tn}.country, 'en') as country_display_name ");
$tn = $this->tableName();
//DB_DataObject::debugLevel(1);
if (!empty($q['query']['company_project_id'])) {
$add = '';
if (!empty($q['query']['company_include_self'])) {
- $add = ' OR Companies.id = ' . $x->id;
+ $add = " OR {$tn}.id = {$x->id}";
}
if (!empty($q['query']['company_not_self'])) {
- $add = ' AND Companies.id != ' . $x->id;
+ $add = " AND {$tn}.id != {$x->id}";
}
$pids = array();
$pid = $q['query']['company_project_id'];
$pids = implode(',', $pids);
- $this->whereAdd("Companies.id IN (
+ $this->whereAdd("{$tn}.id IN (
SELECT distinct(company_id) FROM ProjectDirectory where project_id IN ($pids)
) $add" );