Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[Core: Candidate] Fix getFirstVisit method #4075

Merged
merged 17 commits into from
Jan 28, 2019
10 changes: 4 additions & 6 deletions php/libraries/Candidate.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -621,13 +621,11 @@ class Candidate
$db = $factory->database();

$candID = $this->getCandID();

$query = "SELECT Visit_label
FROM session s JOIN candidate c ON (c.CandID = s.CandID)
WHERE c.CandID=:cid AND Date_Visit IS NOT NULL
ORDER BY Date_Visit";
$query = "SELECT Visit_label FROM session
WHERE CandID = :cid AND Date_visit IS NOT NULL
ORDER BY Date_visit, ID ASC LIMIT 1";
$where = array('cid' => $candID);
$vLabel = $db->pselectOne($query, $where);
$vLabel = $db->pselectCol($query, $where)[0] ?? null;
davidblader marked this conversation as resolved.
Show resolved Hide resolved

return $vLabel;
}
Expand Down