Leaving the query as it is.

This commit is contained in:
sergiotarxz 2023-05-02 19:11:35 +02:00
parent 4fec83a864
commit ca3a8d4fce
1 changed files with 5 additions and 8 deletions

View File

@ -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;
}