stats for festivals

This commit is contained in:
ty kayn 2019-06-12 15:36:14 +02:00
parent be87086536
commit 52f3b775c2
2 changed files with 6 additions and 5 deletions

View File

@ -22,9 +22,9 @@
var dataPointsFestivals = [ var dataPointsFestivals = [
{% for pair in statisticsFestivals %} {% for pair in statisticsFestivals %}
{ {
label: "{{ pair.date|date('Y-m-d') }}", label: "{{ pair.name }} {{ pair.date|date('Y-m-d') }} , {{ pair.chiffreAffaire }}",
y: {{ pair.chiffreAffaire }} , y: {{ pair.chiffreAffaire }} ,
countClients : {{ pair.clients_count }} countClients : "{{ pair.clients_count }} clients"
}, },
{% endfor %} {% endfor %}
]; ];
@ -37,7 +37,7 @@
data: [ data: [
{ {
// Change type to "doughnut", "line", "splineArea", etc. // Change type to "doughnut", "line", "splineArea", etc.
type: "line", type: "column",
dataPoints: dataPointsFestivals dataPoints: dataPointsFestivals
} }
] ]

View File

@ -344,7 +344,7 @@ class DefaultController extends Controller
// ['name' => 'bidule', 'count' => 0, 'value' => 0], // ['name' => 'bidule', 'count' => 0, 'value' => 0],
]; ];
$statsForFestival = [ $statsForFestivalMock = [
['name' => 'festoche bidule', 'clients_count' => 125, 'chiffreAffaire' => 236, 'date' => new \DateTime()], ['name' => 'festoche bidule', 'clients_count' => 125, 'chiffreAffaire' => 236, 'date' => new \DateTime()],
]; ];
foreach ($allSellingList as $client) { foreach ($allSellingList as $client) {
@ -373,7 +373,8 @@ class DefaultController extends Controller
return $this->render('logged/history.html.twig', return $this->render('logged/history.html.twig',
[ [
'statisticsFestivals' => $statsForFestival, // 'statisticsFestivals' => $statsForFestivalMock, // mock of festival stats
'statisticsFestivals' => $statisticsFestivals,
'statisticsSoldProducts' => $statisticsSoldProducts, 'statisticsSoldProducts' => $statisticsSoldProducts,
'chiffreAffaires' => $chiffreAffaires, 'chiffreAffaires' => $chiffreAffaires,
'recentSells' => $mySellings, 'recentSells' => $mySellings,