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
a92a0e42
Commit
a92a0e42
authored
Nov 30, 2020
by
Zohten
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
better than select *
parent
d52161c9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
4 deletions
+18
-4
RoundController.class.php
BackEnd/src/controller/RoundController.class.php
+9
-3
Round.sql.php
BackEnd/src/sql/Round.sql.php
+9
-1
No files found.
BackEnd/src/controller/RoundController.class.php
View file @
a92a0e42
...
@@ -19,11 +19,17 @@ class RoundController extends Controller
...
@@ -19,11 +19,17 @@ class RoundController extends Controller
switch
(
$httpMethod
)
{
switch
(
$httpMethod
)
{
case
'GET'
:
case
'GET'
:
// If there is a uriParams, it is the /round/{id} endpoint
// If there is a uriParams, it is the /round/{id}
or /round/{id}/user
endpoint
if
(
$uriParams
)
{
if
(
$uriParams
)
{
return
$this
->
getUsersInRound
(
$uriParams
[
0
]);
$lenUriParams
=
count
(
$uriParams
);
// Check if it is the /round/{id}/user endpoint
if
((
$lenUriParams
==
2
)
&&
(
$uriParams
[
1
]
==
'user'
))
{
return
$this
->
getUsersInRound
(
$uriParams
[
0
]);
}
// Nope, it is the /round/{id} endpoint
return
$this
->
getRound
(
$uriParams
[
0
]);
}
}
//
Else
, it is the /round endpoint
//
If there is no uriParams
, it is the /round endpoint
return
$this
->
getAllRounds
();
return
$this
->
getAllRounds
();
break
;
break
;
}
}
...
...
BackEnd/src/sql/Round.sql.php
View file @
a92a0e42
...
@@ -12,7 +12,15 @@ Game::addSqlQuery(
...
@@ -12,7 +12,15 @@ Game::addSqlQuery(
Game
::
addSqlQuery
(
Game
::
addSqlQuery
(
'ROUND_GET_USERS'
,
'ROUND_GET_USERS'
,
'SELECT *
'SELECT usr.ID_USER,
usr.ID_ROLE,
usr.LOGIN,
usr.AVATAR,
usr.LASTNAME,
usr.FIRSTNAME,
usr.MAIL,
usr.BAN_ACCOUNT,
usr.LAST_IP
FROM MJ_USER as usr
FROM MJ_USER as usr
JOIN MJ_PLAY as p on p.ID_USER = usr.ID_USER
JOIN MJ_PLAY as p on p.ID_USER = usr.ID_USER
JOIN MJ_ROUND as r on r.ID_ROUND = p.ID_ROUND
JOIN MJ_ROUND as r on r.ID_ROUND = p.ID_ROUND
...
...
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