Commit f6327d31 authored by Zohten's avatar Zohten

Merry Xmas

parent 2949fe79
......@@ -21,9 +21,9 @@ VALUES
INSERT INTO `MJ_GAME` (ID_GAME, PRIVATE, CREATION_TIME)
VALUES
(1, True, '2020/10/22 01:00:00'),
(2, True, '2019/10/22 01:00:00'),
(3, False, '2020/10/24 01:00:00'),
(1, False, '2020/10/22 01:00:00'),
(2, False, '2019/10/22 01:00:00'),
(3, True, '2020/10/24 01:00:00'),
(4, False, '2019/10/24 01:00:00');
/* Ajouter un numéro de manche
......@@ -33,7 +33,8 @@ INSERT INTO `MJ_ROUND` (ID_ROUND ,ID_GAME ,PREVAILING_WIND ,SEED ,BEGINING ,ENDI
VALUES
(1, 1, 1, 12345, '2020/10/22 01:10:00', '2020/10/22 01:12:00', 'a very long string describing actions of each players'),
(2, 1, 2, 54321, '2020/10/22 01:12:10', '2020/10/22 01:13:00', 'a very long string describing actions of each players'),
(3, 1, 2, 15243, '2020/10/22 01:12:10', NULL, 'a very long string describing actions of each players');
(3, 1, 2, 15243, '2020/10/22 01:12:10', NULL, 'a very long string describing actions of each players'),
(4, 2, 2, 15243, '2020/10/22 01:12:10', NULL, 'a very long string describing actions of each players');
/*Renomer WIND en USER_WIND*/
INSERT INTO `MJ_PLAY` (ID_USER, ID_ROUND, WIN, SCORE, HOST, WIND)
......@@ -49,7 +50,8 @@ VALUES
(1, 3, NULL, 12000, True, 1),
(2, 3, NULL, 11000, False, 2),
(3, 3, NULL, 10000, False, 3),
(4, 3, NULL, 9000, False, 4);
(4, 3, NULL, 9000, False, 4),
(7, 4, NULL, 0, True, NULL);
/*INSERT INTO MJ_ROOM (ID_ROOM ,ID_USER ,PRIVATE ,DATE_BEGIN ,DATE_END)
VALUES
......
......@@ -7,15 +7,16 @@ Game::addSqlQuery(
Game::addSqlQuery(
'GAME_LIST_PUBLIC',
'SELECT ID_GAME, NB_PLAYER
'SELECT ID_GAME, NB_PLAYER, u.LOGIN
FROM(
SELECT g.ID_GAME, count(p.ID_USER) as NB_PLAYER, count(r.ID_ROUND) as NB_ROUND_PLAYED
SELECT g.ID_GAME, count(p.ID_USER) as NB_PLAYER, count(r.ID_ROUND) as NB_ROUND_PLAYED, p.ID_USER
FROM MJ_GAME as g
JOIN MJ_ROUND as r on g.ID_GAME = r.ID_GAME
JOIN MJ_PLAY as p on r.ID_ROUND = p.ID_ROUND
WHERE g.PRIVATE=0
WHERE g.PRIVATE=0 AND p.HOST=1
GROUP BY g.ID_GAME, p.ID_USER
) as r
JOIN MJ_USER as u on r.ID_USER=u.ID_USER
WHERE r.NB_PLAYER <=3 AND r.NB_ROUND_PLAYED=1'
);
......
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