Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
LQDN Adminsys
don
Commits
55459c47
Commit
55459c47
authored
Dec 20, 2018
by
Okhin
Browse files
Fond a copy pasta that incremented twice total and never cumul
parent
8f034678
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
app/controller/admin.php
View file @
55459c47
...
...
@@ -177,7 +177,7 @@ class Admin extends Controller
$status
=
1
;
}
$total
=
$user_amount
[
'total'
]
+
$result
[
'somme'
];
$cumul
=
$user_amount
[
'
tota
l'
]
+
$result
[
'somme'
];
$cumul
=
$user_amount
[
'
cumu
l'
]
+
$result
[
'somme'
];
}
if
(
$error
!=
''
)
{
$f3
->
push
(
'SESSION.error'
,
$error
);
...
...
@@ -225,7 +225,7 @@ class Admin extends Controller
$status
=
0
;
}
$total
=
$user_amount
[
'total'
]
-
$result
[
'somme'
];
$cumul
=
$user_amount
[
'
tota
l'
]
-
$result
[
'somme'
];
$cumul
=
$user_amount
[
'
cumu
l'
]
-
$result
[
'somme'
];
if
(
$cumul
<
0
)
{
$error
=
"Impossible d'invalider, une contrepartie a été demandée"
;
}
...
...
app/controller/bank.php
View file @
55459c47
...
...
@@ -159,7 +159,7 @@ class Bank extends Controller
if
(
$status
!=
101
)
{
$cb_log
->
write
(
"Ajout de "
.
$don
[
'somme'
]);
$f3
->
get
(
'container'
)[
'command_handler'
]
->
handle
(
new
UserUpdateTotalCommand
(
$user
[
'id'
],
(
int
)
$user
[
'total'
]
+
$don
[
'somme'
]));
$f3
->
get
(
'container'
)[
'command_handler'
]
->
handle
(
new
UserUpdateCumulCommand
(
$user
[
'id'
],
(
int
)
$user
[
'cumul'
]
+
$don
[
'
cumul
'
]));
$f3
->
get
(
'container'
)[
'command_handler'
]
->
handle
(
new
UserUpdateCumulCommand
(
$user
[
'id'
],
(
int
)
$user
[
'cumul'
]
+
$don
[
'
somme
'
]));
}
$result
=
$db
->
query
(
"SELECT cumul FROM users WHERE id='"
.
$don
[
'user_id'
]
.
"'"
);
$cumul
=
$result
->
fetch
(
\
PDO
::
FETCH_ASSOC
);
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment