mirror of
https://gitlab.com/animath/si/plateforme.git
synced 2025-06-26 05:57:39 +02:00
Support des lettres de motivation
This commit is contained in:
@ -435,6 +435,17 @@ class User
|
||||
while (($data = $req->fetch()) !== false)
|
||||
$docs[] = Document::fromData($data);
|
||||
|
||||
if ($this->team_id > 0) {
|
||||
$req = $DB->query("SELECT * FROM `documents` AS `t1` "
|
||||
. "INNER JOIN (SELECT `user`, `type`, `tournament`, MAX(`uploaded_at`) AS `last_upload`, COUNT(`team`) AS `version` FROM `documents` GROUP BY `tournament`, `type`, `user`) `t2` "
|
||||
. "ON `t1`.`user` = `t2`.`user` AND `t1`.`type` = `t2`.`type` AND `t1`.`tournament` = `t2`.`tournament` "
|
||||
. "WHERE `t1`.`uploaded_at` = `t2`.`last_upload` AND `t1`.`tournament` = $tournament_id AND `t1`.`team` = $this->team_id "
|
||||
. "AND `t1`.`type` = 'MOTIVATION_LETTER';");
|
||||
|
||||
while (($data = $req->fetch()) !== false)
|
||||
$docs[] = Document::fromData($data);
|
||||
}
|
||||
|
||||
return $docs;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user