Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
projet-cdaw
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Quentin Vrel
projet-cdaw
Commits
f6327d31
Commit
f6327d31
authored
Dec 02, 2020
by
Zohten
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merry Xmas
parent
2949fe79
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
8 deletions
+11
-8
sample.sql
AGL/BD/sample.sql
+7
-5
Game.sql.php
BackEnd/src/sql/Game.sql.php
+4
-3
No files found.
AGL/BD/sample.sql
View file @
f6327d31
...
...
@@ -21,9 +21,9 @@ VALUES
INSERT
INTO
`MJ_GAME`
(
ID_GAME
,
PRIVATE
,
CREATION_TIME
)
VALUES
(
1
,
Tru
e
,
'2020/10/22 01:00:00'
),
(
2
,
Tru
e
,
'2019/10/22 01:00:00'
),
(
3
,
Fals
e
,
'2020/10/24 01:00:00'
),
(
1
,
Fals
e
,
'2020/10/22 01:00:00'
),
(
2
,
Fals
e
,
'2019/10/22 01:00:00'
),
(
3
,
Tru
e
,
'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
...
...
BackEnd/src/sql/Game.sql.php
View file @
f6327d31
...
...
@@ -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'
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment