You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if($election_open_date <= $cut_date) { // until January 2014
76
-
$sql = <<<SQL
77
-
-- members that did not vote on any latest election
78
-
select DISTINCT M.ID from Member M
79
-
inner join Group_Members gm on gm.MemberID = M.ID
80
-
inner join `Group` g on g.ID = gm.GroupID and g.Code = 'foundation-members'
81
-
inner join LegalAgreement la on la.MemberID = M.ID and la.LegalDocumentPageID = 422 and la.Created <= '2012-08-15 23:59:59'
82
-
where not exists (
83
-
select V.ID
84
-
from ElectionVote V
85
-
inner join Election E on V.ElectionID = E.ID
86
-
where E.ID in ({$elections_id}) and V.VoterID = M.ID-- latest elections
87
-
)
88
-
and not exists(select id from FoundationMemberRevocationNotification rn where rn.RecipientID = M.ID and rn.Action = 'None') -- there is not any pending notification
89
-
and not exists(select id from FoundationMemberRevocationNotification rn where rn.RecipientID = M.ID and rn.Action = 'Renew' and rn.LastElectionID = {$latest_election_id}) -- there are not rewnews for the current election
90
-
limit {$offset},{$limit};
91
-
92
-
SQL;
93
-
return$sql;
94
-
}
95
-
elseif($election_open_date > $cut_date){ // newer elections -- moving forward for all future elections after Jan. 2015
96
-
97
-
// All members that joined on or before (180 days before the ElectionClose date of the earliest election
98
-
// that has occurred in the last 2 years) have voted in none of the last two elections
-- members that did not vote on any latest election
107
84
SELECT DISTINCT M.ID FROM Member M
108
85
inner join Group_Members gm on gm.MemberID = M.ID
109
86
inner join `Group` g on g.ID = gm.GroupID and g.Code = 'foundation-members'
110
-
inner join LegalAgreement la on la.MemberID = M.ID and la.LegalDocumentPageID = 422 and la.Created <= date_add('{$early_election_server_close_date}', interval -180 day)
87
+
inner join LegalAgreement la on la.MemberID = M.ID and la.LegalDocumentPageID = 422 and la.Created <= date_add('{$latest_election_server_close_date}', interval -180 day)
111
88
where not exists (
112
89
select V.ID
113
90
from ElectionVote V
@@ -118,8 +95,10 @@ public function sql($latest_elections_qty, $necessary_votes, IElectionRepository
118
95
and not exists(select id from FoundationMemberRevocationNotification rn where rn.RecipientID = M.ID and rn.Action = 'Renew' and rn.LastElectionID = {$latest_election_id}) -- there are not renew for the current election
0 commit comments