1
0
mirror of https://gitlab.com/animath/si/plateforme-corres2math.git synced 2025-07-03 14:42:47 +02:00

Divserses corrections, phase 0 terminée

This commit is contained in:
galaxyoyo
2019-09-12 16:01:40 +02:00
parent 416264b53c
commit 61bec11bdb
7 changed files with 17 additions and 16 deletions

View File

@ -80,13 +80,13 @@ class Document
public function getAllDocuments($problem)
public static function getAllDocuments($problem, $team_id = -1)
{
global $DB;
$req = $DB->query("SELECT * FROM `documents` AS `t1` "
. "INNER JOIN (SELECT `user`, `type`, `problem`, MAX(`uploaded_at`) AS `last_upload`, COUNT(`team`) AS `version` FROM `documents` GROUP BY `problem`, `type`, `user`) `t2` "
. "ON `t1`.`user` = `t2`.`user` AND `t1`.`type` = `t2`.`type` AND `t1`.`problem` = `t2`.`problem` "
. "WHERE `t1`.`uploaded_at` = `t2`.`last_upload` AND `t1`.`problem` = $problem ORDER BY `t1`.`type`;");
. "WHERE `t1`.`uploaded_at` = `t2`.`last_upload` AND `t1`.`problem` = $problem " . ($team_id >= 0 ? "AND `team` = $team_id" : "") . " ORDER BY `t1`.`type`;");
$docs = [];