Commit abb23dae authored by Zohten's avatar Zohten

added public list

parent e782749d
...@@ -7,11 +7,16 @@ Game::addSqlQuery( ...@@ -7,11 +7,16 @@ Game::addSqlQuery(
Game::addSqlQuery( Game::addSqlQuery(
'GAME_LIST_PUBLIC', 'GAME_LIST_PUBLIC',
'SELECT g.ID_GAME 'SELECT ID_GAME, NB_PLAYER
FROM(
SELECT g.ID_GAME, count(p.ID_USER) as NB_PLAYER, count(r.ID_ROUND) as NB_ROUND_PLAYED
FROM MJ_GAME as g FROM MJ_GAME as g
JOIN MJ_ROUND as r on g.ID_GAME = r.ID_GAME JOIN MJ_ROUND as r on g.ID_GAME = r.ID_GAME
JOIN MJ_PLAY as p on r.ID_ROUND = p.ID_ROUND JOIN MJ_PLAY as p on r.ID_ROUND = p.ID_ROUND
WHERE g.PRIVATE=0' WHERE g.PRIVATE=0
GROUP BY g.ID_GAME, p.ID_USER
) as r
WHERE r.NB_PLAYER <=3 AND r.NB_ROUND_PLAYED=1'
); );
Game::addSqlQuery( Game::addSqlQuery(
......
...@@ -11,5 +11,5 @@ GET http://localhost/index.php/game/public ...@@ -11,5 +11,5 @@ GET http://localhost/index.php/game/public
POST http://localhost/index.php/game POST http://localhost/index.php/game
{ {
"is_private": "1" "is_private": "0"
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment