Answer the question
In order to leave comments, you need to log in
Is select working incorrectly and/or strange in Laravel's DB:select?
I created the following sql query to the database
select
date,
site,
uin,
raw
from
(select
date(date) as date,
site as site,
sum(uin) as uin,
sum(raw) as raw
from
daily_stats
WHERE
site = 'all' and
month(date) = month(curdate())
group by site, date
) as daily_sum
order by date
limit 1;
$statsRows = DB::select('select
date,
site,
uin,
raw
from
(select
date(date) as date,
site as site,
sum(uin) as uin,
sum(raw) as raw
from
daily_stats
WHERE
site = :site and
month(date) = month(:month)
group by site, date
) as daily_sum
order by date;
',
[
'site' => $site,
'month' => $month
]);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question