Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
kohinos
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
9
Issues
9
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
cooperatic-mlc
kohinos
Commits
98516315
Commit
98516315
authored
Mar 13, 2019
by
Julien Jorry
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix stats for presta / partenaire on homepage
parent
1894398b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
17 deletions
+11
-17
StatsExtension.php
src/Twig/StatsExtension.php
+11
-17
No files found.
src/Twig/StatsExtension.php
View file @
98516315
...
...
@@ -32,33 +32,29 @@ class StatsExtension extends AbstractExtension
public
function
showMlcStats
(
$stats
)
{
$class
=
''
;
switch
(
$stats
)
{
switch
(
$stats
)
{
case
'user'
:
$class
=
'App\Entity\User'
;
break
;
case
'prestataire'
:
$class
=
'App\Entity\Prestataire'
;
$class
=
null
;
$typepresta
=
$this
->
em
->
getRepository
(
TypePrestataire
::
class
)
->
findOneBySlug
(
'prestataire'
);
$query
=
$this
->
em
->
createQuery
(
'SELECT count(distinct p.id)
FROM '
.
$class
.
' p
WHERE p.enabled = true AND p.typeprestataire = :typepresta
'
)
->
setParameter
(
'typepresta'
,
$typepresta
)
;
FROM App\\Entity\\Prestataire p
WHERE p.enabled = true AND p.typeprestataire = :typepresta'
)
->
setParameter
(
'typepresta'
,
$typepresta
);
$val
=
$query
->
getSingleScalarResult
();
break
;
case
'partenaire'
:
$class
=
'App\Entity\Prestataire'
;
$class
=
null
;
$typepresta
=
$this
->
em
->
getRepository
(
TypePrestataire
::
class
)
->
findOneBySlug
(
'partenaire'
);
$query
=
$this
->
em
->
createQuery
(
'SELECT count(distinct p.id)
FROM '
.
$class
.
' p
WHERE p.enabled = true AND p.typeprestataire = :typepresta
'
)
->
setParameter
(
'typepresta'
,
$typepresta
)
;
FROM App\\Entity\\Prestataire p
WHERE p.enabled = true AND p.typeprestataire = :typepresta'
)
->
setParameter
(
'typepresta'
,
$typepresta
);
$val
=
$query
->
getSingleScalarResult
();
break
;
...
...
@@ -71,15 +67,13 @@ class StatsExtension extends AbstractExtension
case
'groupe'
:
$class
=
'App\Entity\Groupe'
;
break
;
}
if
(
!
empty
(
$class
))
{
$query2
=
$this
->
em
->
createQuery
(
'SELECT count(distinct u.id)
FROM '
.
$class
.
' u
WHERE u.enabled = true
'
)
;
WHERE u.enabled = true'
);
$val
=
$query2
->
getSingleScalarResult
();
}
...
...
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