Skip to content

Commit

Permalink
CONTRIB-5250: Removed duplicate user fields from SQL query
Browse files Browse the repository at this point in the history
  • Loading branch information
mdjnelson committed Aug 19, 2014
1 parent c061963 commit a11f69a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -728,9 +728,9 @@ function certificate_get_issues($certificateid, $sort="ci.timecreated ASC", $gro
// Get all the users that have certificates issued, should only be one issue per user for a certificate
$allparams = $conditionsparams + array('certificateid' => $certificateid);

$namefields = get_all_user_name_fields(true, 'u');
// The picture fields also include the name fields for the user.
$picturefields = user_picture::fields('u');
$users = $DB->get_records_sql("SELECT u.id, u.idnumber, $namefields, $picturefields, ci.code, ci.timecreated
$users = $DB->get_records_sql("SELECT $picturefields, u.idnumber, ci.code, ci.timecreated
FROM {user} u
INNER JOIN {certificate_issues} ci
ON u.id = ci.userid
Expand Down

0 comments on commit a11f69a

Please sign in to comment.