This commit is contained in:
xdrm-brackets 2018-03-29 20:36:41 +02:00
commit 53e671457d
1 changed files with 18 additions and 2 deletions

View File

@ -190,11 +190,27 @@ class ue extends Repo_i {
ue.volumeTP,
IFNULL(ue.Formation_idFormation, -1) idForm,
fdef.labelFormation labelForm,
IFNULL(formlist.formations, '[]') formations
IFNULL(formlist.formations, '[]') formations,
IFNULL(formlist.nbrCours,0) nbrCours,
IFNULL(formlist.nbrTD,0) nbrTD,
IFNULL(formlist.nbrTP,0) nbrTP,
IFNULL(formlist.modCours,0) modCours,
IFNULL(formlist.modTD,0) modTD,
IFNULL(formlist.modTP,0) modTP,
IFNULL(formlist.nbrProfCours,0) nbrProfCours,
IFNULL(formlist.nbrProfTD,0) nbrProfTD,
IFNULL(formlist.nbrProfTP,0) nbrProfTP
FROM UE ue
LEFT JOIN Formation fdef ON ue.Formation_idFormation = fdef.idFormation
LEFT JOIN (
SELECT ue2.code code, CONCAT('[',GROUP_CONCAT(DISTINCT Formation.idFormation), ']') formations
SELECT ue2.code code, CONCAT('[',GROUP_CONCAT(DISTINCT Formation.idFormation), ']') formations,
count(DISTINCT C.idCours) nbrCours, count(DISTINCT T.idTD) nbrTD, count(DISTINCT T2.idTP) nbrTP,
MOD(sum(DISTINCT C.volume),ue2.volumeCours) modCours,
MOD(sum(DISTINCT T.volume),ue2.volumeTD) modTD,
MOD(sum(DISTINCT T2.volume),ue2.volumeTP) modTP,
count(DISTINCT C.Professeur_idProfesseur) nbrProfCours,
count(DISTINCT T.Professeur_idProfesseur) nbrProfTD,
count(DISTINCT T2.Professeur_idProfesseur) nbrProfTP
FROM UE ue2
LEFT JOIN Cours C ON ue2.code = C.UE_code
LEFT JOIN TD T ON ue2.code = T.UE_code