1
0
mirror of https://gitlab.com/animath/si/plateforme-corres2math.git synced 2025-06-24 19:40:28 +02:00

L'autorisation de droit à l'image est désormais sur la page "Mon compte"

This commit is contained in:
Yohann
2019-10-04 21:31:34 +02:00
parent a73b0889b4
commit dc3f81b6d3
5 changed files with 92 additions and 86 deletions

View File

@ -258,13 +258,13 @@ class User
$DB->prepare("UPDATE `users` SET `receive_animath_mails` = ? WHERE `id` = ?;")->execute([$receive_animath_mails ? 1 : 0, $this->getId()]);
}
public function getAllDocuments($problem)
public function getAllDocuments()
{
global $DB;
$req = $DB->query("SELECT * FROM `documents` AS `t1` "
. "INNER JOIN (SELECT `user`, `problem`, MAX(`uploaded_at`) AS `last_upload`, COUNT(`team`) AS `version` FROM `documents` GROUP BY `problem`, `user`) `t2` "
. "ON `t1`.`user` = `t2`.`user` AND `t1`.`problem` = `t2`.`problem` "
. "WHERE `t1`.`uploaded_at` = `t2`.`last_upload` AND `t1`.`problem` = $problem AND `t1`.`user` = $this->id;");
. "INNER JOIN (SELECT `user`, MAX(`uploaded_at`) AS `last_upload`, COUNT(`team`) AS `version` FROM `documents` GROUP BY `problem`, `user`) `t2` "
. "ON `t1`.`user` = `t2`.`user` "
. "WHERE `t1`.`uploaded_at` = `t2`.`last_upload` AND `t1`.`user` = $this->id;");
$docs = [];