Skip to content
This repository has been archived by the owner on Oct 22, 2020. It is now read-only.

Commit

Permalink
fixed ambiguous field name in on clause task #173
Browse files Browse the repository at this point in the history
  • Loading branch information
emamut committed Oct 11, 2016
1 parent fd5b8af commit e43f431
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions mod/analysis/searchSql.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public function sqlForJsonQuery($json) {
//var_dump('searchQuery',$queryArray);

$this->generateSqlArray();
$sql = $this->getSql();
$sql = $this->getSql();
return $sql;
}

Expand Down Expand Up @@ -554,8 +554,8 @@ public function getFieldAlias($formField, $type = 'query', $entityType = null, $
$entity = $formField["map"]["entity"];
$field = $formField["map"]["field"];

if (is_location_field($entity,$field)){

if (is_location_field($entity,$field)){
return "concat($entity.{$field}_longitude,',',$entity.{$field}_latitude) AS $entity"."_"."$field";
}

Expand All @@ -577,10 +577,10 @@ public function createResult($entity, $field, $type) {
$entityArray = $this->getEntityArray($entity);

$selectField = $this->getFieldAlias($entityArray[$field], $type, $entity);
//var_dump('selectField' , $entityArray[$field]);
//var_dump('selectField' , $entityArray[$field]);
if (($selectField == null || $selectField == '' )) {
error_log(var_export($field,true));
}
error_log(var_export($field,true));
}

if (!($selectField == null || $selectField == '' )) {
$this->sqlArray['select'][$selectField] = $selectField;
Expand Down Expand Up @@ -641,7 +641,7 @@ public function managementJoin($entity) {
}
}
if ($join) {
$this->sqlArray['join'][] = array('table' => 'management', 'jointype' => 'LEFT', 'field1' => 'entity_id', 'field2' => get_primary_key($entity), 'as' => $as, 'condition' => " AND entity_type ='$entity' ");
$this->sqlArray['join'][] = array('table' => 'management', 'jointype' => 'LEFT', 'field1' => $as.'.entity_id', 'field2' => get_primary_key($entity), 'as' => $as, 'condition' => " AND $as.entity_type ='$entity' ");
}
}

Expand Down

0 comments on commit e43f431

Please sign in to comment.