Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Learning and Work
managing-money-api
Commits
2c09c5a6
Commit
2c09c5a6
authored
Jun 27, 2018
by
Jack Stupple
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tweak to the logic (sorry, wrking on stage)
parent
4abce408
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
app/Answer.php
app/Answer.php
+3
-3
app/Character.php
app/Character.php
+3
-3
No files found.
app/Answer.php
View file @
2c09c5a6
...
...
@@ -19,11 +19,11 @@ class Answer extends Model
public
function
modifiers
()
{
$
selected_currency
=
Player
::
select
(
'currency_id'
)
->
where
(
'session_id'
,
'='
,
$_SERVER
[
'HTTP_SESSION_ID'
])
->
first
();
if
(
$
selected_
currency
)
{
$
player
=
Player
::
where
(
'session_id'
,
'='
,
$_SERVER
[
'HTTP_SESSION_ID'
])
->
first
();
if
(
$
player
->
currency
_id
)
{
return
$this
->
hasMany
(
\
App\Modifier
::
class
,
'model_id'
)
->
where
(
'model'
,
'='
,
'answer'
)
->
where
(
'currency_id'
,
'='
,
$
selected_
currency
->
id
);
->
where
(
'currency_id'
,
'='
,
$
player
->
currency
_
id
);
}
else
{
$default_currency
=
Currency
::
where
(
'currency_code'
,
'EUR'
)
->
firstOrFail
();
return
$this
->
hasMany
(
\
App\Modifier
::
class
,
'model_id'
)
...
...
app/Character.php
View file @
2c09c5a6
...
...
@@ -17,12 +17,12 @@ class Character extends Model
public
function
baseModifiers
()
{
$
selected_currency
=
Player
::
select
(
'currency_id'
)
->
where
(
'session_id'
,
'='
,
$_SERVER
[
'HTTP_SESSION_ID'
])
->
first
();
$
player
=
Player
::
where
(
'session_id'
,
'='
,
$_SERVER
[
'HTTP_SESSION_ID'
])
->
first
();
if
(
$
selected_
currency
)
{
if
(
$
player
->
currency
_id
)
{
return
$this
->
hasMany
(
Modifier
::
class
,
'model_id'
)
->
where
(
'model'
,
'='
,
'character'
)
->
where
(
'currency_id'
,
'='
,
$
selected_
currency
->
id
);
->
where
(
'currency_id'
,
'='
,
$
player
->
currency
_
id
);
}
else
{
$default_currency
=
Currency
::
where
(
'currency_code'
,
'EUR'
)
->
firstOrFail
();
return
$this
->
hasMany
(
Modifier
::
class
,
'model_id'
)
...
...
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