Niharika29 has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/183253

Change subject: Update language report to show only those applications which 
have passed phase 1
......................................................................

Update language report to show only those applications which
have passed phase 1

Mentioned in:
Bug: T85017

Change-Id: I179812c55e4e6aa1164be9fd1c04ecf77ee09c17
---
M src/Wikimania/Scholarship/Dao/Apply.php
1 file changed, 17 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/wikimania-scholarships 
refs/changes/53/183253/1

diff --git a/src/Wikimania/Scholarship/Dao/Apply.php 
b/src/Wikimania/Scholarship/Dao/Apply.php
index a3bd267..45d2eb9 100644
--- a/src/Wikimania/Scholarship/Dao/Apply.php
+++ b/src/Wikimania/Scholarship/Dao/Apply.php
@@ -619,12 +619,27 @@
         * Multilingual community - Global South
         */
        public function getListOfCommunities() {
+
+               $p1scoreSql = $this->makeAggregateRankSql( 'valid', 'SUM', 
'p1score' );
+
+               $fields = array(
+                       'count(*) as sid',
+                       'l.size',
+                       'c.globalns',
+                       'COALESCE(p1score, 0) as p1score',
+                       's.exclude',
+               );
+
                return $this->fetchAll( self::concat(
-                       "SELECT count(*) as sid, l.size, c.globalns",
+                       "SELECT", implode( ',', $fields ),
                        "FROM scholarships s",
+                       "LEFT OUTER JOIN ({$p1scoreSql}) r2 ON s.id = 
r2.scholarship_id",
                        "LEFT JOIN language_communities l ON l.code = 
s.community",
                        "LEFT JOIN iso_countries c ON c.code = s.residence",
-                       "GROUP BY l.size"
+                       "GROUP BY l.size",
+                       "HAVING p1score >= :int_phase1pass AND s.exclude = 0"
+               ), array(
+                       'int_phase1pass' => (int)$this->settings['phase1pass'],
                ) );
        }
 

-- 
To view, visit https://gerrit.wikimedia.org/r/183253
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I179812c55e4e6aa1164be9fd1c04ecf77ee09c17
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/wikimania-scholarships
Gerrit-Branch: master
Gerrit-Owner: Niharika29 <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to