Skip to content

Commit

Permalink
update sql syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewPoppe committed Aug 17, 2021
1 parent b099a07 commit 5e7e102
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/classes/ParticipantHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ public function expirePasswordResetToken($rcpro_participant_id)
*/
public function getAllParticipants()
{
$SQL = "SELECT log_id, rcpro_username, email, fname, lname, lockout_ts, CASE WHEN pw IS NULL OR pw = '' THEN 'False' ELSE 'True' END AS pw_set WHERE message = 'PARTICIPANT' AND (project_id IS NULL OR project_id IS NOT NULL)";
$SQL = "SELECT log_id, rcpro_username, email, fname, lname, lockout_ts, (CASE WHEN (pw IS NULL OR pw = '') THEN 'False' ELSE 'True' END) AS pw_set WHERE message = 'PARTICIPANT' AND (project_id IS NULL OR project_id IS NOT NULL)";
try {
$result = self::$module->queryLogs($SQL, []);
$participants = array();
Expand Down Expand Up @@ -378,7 +378,7 @@ public function getProjectParticipants(string $rcpro_project_id, ?int $dag = NUL
$participants = array();

while ($row = $result->fetch_assoc()) {
$participantSQL = "SELECT log_id, rcpro_username, email, fname, lname, lockout_ts, CASE WHEN pw IS NULL OR pw = '' THEN 'False' ELSE 'True' END AS pw_set WHERE message = 'PARTICIPANT' AND log_id = ? AND (project_id IS NULL OR project_id IS NOT NULL)";
$participantSQL = "SELECT log_id, rcpro_username, email, fname, lname, lockout_ts, (CASE WHEN (pw IS NULL OR pw = '') THEN 'False' ELSE 'True' END) AS pw_set WHERE message = 'PARTICIPANT' AND log_id = ? AND (project_id IS NULL OR project_id IS NOT NULL)";
$participantResult = self::$module->queryLogs($participantSQL, [$row["rcpro_participant_id"]]);
$participant = $participantResult->fetch_assoc();
$participants[$row["rcpro_participant_id"]] = $participant;
Expand Down

0 comments on commit 5e7e102

Please sign in to comment.