From ca3a8d4fceef2de6442010874f8ccb2a15cf64a5 Mon Sep 17 00:00:00 2001 From: sergiotarxz Date: Tue, 2 May 2023 19:11:35 +0200 Subject: [PATCH] Leaving the query as it is. --- lib/BurguillosInfo/Tracking.pm | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/lib/BurguillosInfo/Tracking.pm b/lib/BurguillosInfo/Tracking.pm index f6c681f..73f1fb0 100644 --- a/lib/BurguillosInfo/Tracking.pm +++ b/lib/BurguillosInfo/Tracking.pm @@ -63,18 +63,16 @@ SELECT $SELECT_GLOBAL where date > NOW() - interval '1 month' ) as unique_ips_last_month; - - EOF return $data; } sub get_data_for_urls { my $self = shift; - my $c = shift; - my $app = $c->app; - my $dbh = BurguillosInfo::DB->connect($app); - my $data = $dbh->selectall_arrayref(<<"EOF", {Slice => {}}); + my $c = shift; + my $app = $c->app; + my $dbh = BurguillosInfo::DB->connect($app); + my $data = $dbh->selectall_arrayref(<<"EOF", {Slice => {}}); SELECT paths.path, ( $SELECT_GLOBAL @@ -88,8 +86,7 @@ SELECT paths.path, $SELECT_GLOBAL where requests.path = paths.path and date > NOW() - interval '1 month' ) as unique_ips_last_month -FROM paths INNER JOIN requests on paths.path = requests.path -WHERE requests.date > NOW() - interval '1 month'; +FROM paths; EOF return $data; }