Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SCHULER_VISENTINI_KBIDA_TARDIEU_BDD_Applications_S4
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SCHULER Killian
SCHULER_VISENTINI_KBIDA_TARDIEU_BDD_Applications_S4
Commits
26cbd7b3
Commit
26cbd7b3
authored
5 years ago
by
Loïc
Browse files
Options
Downloads
Patches
Plain Diff
Validation des 3 premières requettes
parent
d9dcced4
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
tp2/src/controllers/ControleurRequete.php
+12
-12
12 additions, 12 deletions
tp2/src/controllers/ControleurRequete.php
tp2/src/models/Game_publishers.php
+14
-0
14 additions, 0 deletions
tp2/src/models/Game_publishers.php
tp2/src/models/Perso.php
+14
-0
14 additions, 0 deletions
tp2/src/models/Perso.php
with
40 additions
and
12 deletions
tp2/src/controllers/ControleurRequete.php
+
12
−
12
View file @
26cbd7b3
...
@@ -5,9 +5,9 @@ namespace bdd\controllers;
...
@@ -5,9 +5,9 @@ namespace bdd\controllers;
use
bdd\models\Company
;
use
bdd\models\Company
;
use
bdd\models\Game
;
use
bdd\models\Game
;
use
bdd\models\Platform
;
use
bdd\models\Platform
;
use
bdd\models\
Character
;
use
bdd\models\
Perso
;
use
bdd\models\Game2character
;
use
bdd\models\Game2character
;
use
bdd\models\Game_publisher
;
use
bdd\models\Game_publisher
s
;
use
bdd\views\RequeteView
;
use
bdd\views\RequeteView
;
class
ControleurRequete
{
class
ControleurRequete
{
...
@@ -45,29 +45,29 @@ class ControleurRequete{
...
@@ -45,29 +45,29 @@ class ControleurRequete{
}
}
public
function
selectChar
(){
public
function
selectChar
(){
$data
=
Character
::
join
(
'game2character'
,
'character.id'
,
'='
,
'game2character.character_id
'
)
$data
=
Perso
::
select
(
'id'
,
'deck
'
)
->
select
(
'id'
,
'deck
'
)
->
join
(
'game2character'
,
'perso.id'
,
'='
,
'game2character.character_id
'
)
->
where
(
'game2character.game_id'
,
'='
,
'12342'
);
->
where
(
'game2character.game_id'
,
'='
,
'12342'
)
->
get
()
;
$vue
=
new
RequeteView
(
$data
);
$vue
=
new
RequeteView
(
$data
);
$vue
->
render
(
1
);
$vue
->
render
(
1
);
}
}
public
function
selectCharMario
(){
public
function
selectCharMario
(){
$data
=
Character
::
join
(
'game2character'
,
'
character
.id'
,
'='
,
'game2character.character_id'
)
$data
=
Perso
::
join
(
'game2character'
,
'
perso
.id'
,
'='
,
'game2character.character_id'
)
->
join
(
'game'
,
'game2character.game_id'
,
'='
,
'game.id'
)
->
join
(
'game'
,
'game2character.game_id'
,
'='
,
'game.id'
)
->
select
(
'id'
)
->
select
(
'
perso.
id'
)
->
where
(
'game.name'
,
'LIKE'
,
'Mario%'
);
->
where
(
'game.name'
,
'LIKE'
,
'Mario%'
)
->
get
()
;
$vue
=
new
RequeteView
(
$data
);
$vue
=
new
RequeteView
(
$data
);
$vue
->
render
(
1
);
$vue
->
render
(
1
);
}
}
public
function
gameCompanySony
(){
public
function
gameCompanySony
(){
$data
=
Game
::
join
(
'game_publisher'
,
'game.id'
,
'='
,
'game_publisher.game_id'
)
$data
=
Game
::
join
(
'game_publisher
s
'
,
'game.id'
,
'='
,
'game_publisher
s
.game_id'
)
->
join
(
'company'
,
'game_publisher.comp_id'
,
'='
,
'company.id'
)
->
join
(
'company'
,
'game_publisher
s
.comp_id'
,
'='
,
'company.id'
)
->
select
(
'
id
'
)
->
select
(
'
game.id'
,
'game.name
'
)
->
where
(
'company.name'
,
'LIKE'
,
'%Sony%'
);
->
where
(
'company.name'
,
'LIKE'
,
'%Sony%'
)
->
get
()
;
$vue
=
new
RequeteView
(
$data
);
$vue
=
new
RequeteView
(
$data
);
$vue
->
render
(
1
);
$vue
->
render
(
1
);
...
...
This diff is collapsed.
Click to expand it.
tp2/src/models/Game_publisher.php
→
tp2/src/models/Game_publisher
s
.php
+
14
−
0
View file @
26cbd7b3
...
@@ -2,13 +2,13 @@
...
@@ -2,13 +2,13 @@
namespace
bdd\models
;
namespace
bdd\models
;
class
Game_publisher
extends
\Illuminate\Database\Eloquent\Model
class
Game_publisher
s
extends
\Illuminate\Database\Eloquent\Model
{
{
protected
$table
=
'game_publisher'
;
protected
$table
=
'game_publisher
s
'
;
protected
$primaryKey
=
'game_id'
;
protected
$primaryKey
=
'game_id'
;
public
$timestamps
=
false
;
public
$timestamps
=
false
;
public
function
platform
(){
public
function
platform
(){
return
$this
->
belongsTo
(
'bdd\models\game_publisher'
,
'game_id'
);
return
$this
->
belongsTo
(
'bdd\models\game_publisher
s
'
,
'game_id'
);
}
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
tp2/src/models/
Character
.php
→
tp2/src/models/
Perso
.php
+
14
−
0
View file @
26cbd7b3
...
@@ -2,13 +2,13 @@
...
@@ -2,13 +2,13 @@
namespace
bdd\models
;
namespace
bdd\models
;
class
Character
extends
\Illuminate\Database\Eloquent\Model
class
Perso
extends
\Illuminate\Database\Eloquent\Model
{
{
protected
$table
=
'
character
'
;
protected
$table
=
'
perso
'
;
protected
$primaryKey
=
'id'
;
protected
$primaryKey
=
'id'
;
public
$timestamps
=
false
;
public
$timestamps
=
false
;
public
function
platform
(){
public
function
platform
(){
return
$this
->
belongsTo
(
'bdd\models\
character
'
,
'id'
);
return
$this
->
belongsTo
(
'bdd\models\
perso
'
,
'id'
);
}
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment