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
91e2f6f9
Commit
91e2f6f9
authored
Dec 03, 2018
by
Okhin
Browse files
Using FETCH_COLUMN for the user id
parent
b4dfbe51
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/LQDN/Handler/UserHandler.php
View file @
91e2f6f9
...
...
@@ -91,8 +91,9 @@ class UserHandler
public
function
handleAdminUpdateTotalUsersCommand
(
AdminUpdateTotalUsersCommand
$command
)
{
// Let's get all users first
$user_ids
=
$this
->
connection
->
executeQuery
(
'SELECT id FROM users'
)
->
fetchAll
(
\
PDO
::
FETCH_
ASSOC
);
$user_ids
=
$this
->
connection
->
executeQuery
(
'SELECT id FROM users'
)
->
fetchAll
(
\
PDO
::
FETCH_
COLUMN
);
var_dump
(
$user_ids
);
foreach
(
$user_ids
as
$user_id
)
{
$user_id
=
(
int
)
$user_id
;
$total
=
$this
->
connection
->
executeQuery
(
'SELECT SUM(somme) AS total FROM dons WHERE user_id = :user_id AND STATUS IN (1, 102)'
,
[
...
...
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