同样一条sql在lumne下查询出来的数据和在mysql命令行查出来的数据有偏差,sql如下;
select count(id) as total, FROM_UNIXTIME(add_time, '%Y-%m-%d') as show_time from kul WHERE status in (1,2,3) AND add_time BETWEEN 1484150400 AND 1486224000 group by show_time ORDER BY show_time DESC
在lumen下查出来的结果是
"2017-02-04" => array:3 [▶]
"2017-02-01" => array:3 [▶]
"2017-01-31" => array:3 [▶]
"2017-01-30" => array:3 [▶]
"2017-01-29" => array:2 [▶]
"2017-01-28" => array:2 [▶]
"2017-01-27" => array:2 [▶]
"2017-01-26" => array:2 [▶]
"2017-01-25" => array:2 [▶]
"2017-01-24" => array:2 [▶]
"2017-01-23" => array:2 [▶]
"2017-01-22" => array:2 [▶]
"2017-01-21" => array:2 [▶]
"2017-01-20" => array:2 [▶]
"2017-01-19" => array:2 [▶]
"2017-01-18" => array:2 [▶]
"2017-01-17" => array:2 [▶]
"2017-01-16" => array:2 [▶]
"2017-01-15" => array:2 [▶]
"2017-01-14" => array:2 [▶]
"2017-01-13" => array:2 [▶]
"2017-01-12
在mysql命令行查出来的结果是
2017-02-05
2017-02-02
2017-02-01
2017-01-31
2017-01-30
2017-01-29
2017-01-28
2017-01-27
2017-01-26
2017-01-25
2017-01-24
2017-01-23
2017-01-22
2017-01-21
2017-01-20
2017-01-19
2017-01-18
2017-01-17
2017-01-16
2017-01-15
2017-01-14
2017-01-13