fix: fix bynote
This commit is contained in:
parent
4567285ec4
commit
f5af049dbb
@ -68,10 +68,11 @@ const getAllModelsByNote = async () => {
|
||||
await client.connect();
|
||||
|
||||
const res = await client.query(
|
||||
"SELECT * FROM noter GROUP BY id_modele ORDER BY AVG(note_noter) DESC"
|
||||
"SELECT modeles.*, AVG(note_noter) as note_moyenne FROM noter JOIN modeles on noter.id_modele = modeles.id_modele GROUP BY modeles.id_modele ORDER BY note_moyenne DESC;"
|
||||
);
|
||||
|
||||
await client.end();
|
||||
console.log(res);
|
||||
return res.rows.map(db2Model);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user