Skip to content

Commit

Permalink
Fix dashboard chart
Browse files Browse the repository at this point in the history
Only first date for log where displayed (like only the first log created) instead of the latest one.

Also fix docker image extension requirements.
  • Loading branch information
j0k3r committed Jul 18, 2022
1 parent 77e304f commit 6f5b46f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
8 changes: 5 additions & 3 deletions docker/Dockerfile-php7.4
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,17 @@ FROM php:7.4-fpm

# Install nginx
RUN apt-get update \
&& apt-get install -y -q nginx libssl-dev build-essential vim git curl zlib1g-dev apt-utils libzip-dev librabbitmq-dev
&& apt-get install -y -q nginx libssl-dev build-essential vim git curl zlib1g-dev apt-utils libzip-dev librabbitmq-dev libtidy-dev unzip

RUN pecl install xdebug amqp \
RUN pecl install xdebug amqp tidy \
&& docker-php-ext-enable xdebug \
&& docker-php-ext-install zip \
&& docker-php-ext-install pdo_mysql \
&& docker-php-ext-install bcmath \
&& docker-php-ext-install sockets \
&& docker-php-ext-enable amqp
&& docker-php-ext-install tidy \
&& docker-php-ext-enable amqp \
&& docker-php-ext-enable tidy

ADD ./fastcgi-php.conf /etc/nginx/snippets/fastcgi-php.conf
ADD ./upstream-php.conf /etc/nginx/conf.d/php7.4-fpm.conf
Expand Down
3 changes: 3 additions & 0 deletions src/Repository/LogRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,13 @@ public function findStatsForLastDays(int $limit = 20)
$res = $this->createQueryBuilder('l')
->select('DATE(l.createdAt) as date, count(l.id) as total')
->groupBy('date')
->orderBy('date', 'desc')
->setMaxResults($limit)
->getQuery()
->getArrayResult();

krsort($res);

$results = [];
foreach ($res as $result) {
list($year, $month, $day) = explode('-', $result['date']);
Expand Down

0 comments on commit 6f5b46f

Please sign in to comment.