fixed #14: 17.8.17新增的延迟绑定抛出的异常

This commit is contained in:
kokororin 2017-09-05 11:55:24 +08:00
parent 3355462054
commit 9b62c860a4

View File

@ -180,12 +180,12 @@ class Access_Core
// "SELECT DISTINCT ip FROM {$this->table} {$where} AND `time` BETWEEN {$start} AND {$end}"));
$this->overview['ip'][$day]['hours'][$i] = intval($this->db->fetchAll($this->db->select('COUNT(1) AS count')
->from('(' . $this->db->select('DISTINCT ip')->from('table.access_log')
->where('time >= ? AND time <= ?', $start, $end) . ') AS tmp'))[0]['count']);
->where("time >= {$start} AND time <= {$end}") . ') AS tmp'))[0]['count']);
$this->overview['ip'][$day]['total'] += $this->overview['ip'][$day]['hours'][$i];
// "SELECT DISTINCT ip,ua FROM {$this->table} {$where} AND `time` BETWEEN {$start} AND {$end}"));
$this->overview['uv'][$day]['hours'][$i] = intval($this->db->fetchAll($this->db->select('COUNT(1) AS count')
->from('(' . $this->db->select('DISTINCT ip,ua')->from('table.access_log')
->where('time >= ? AND time <= ?', $start, $end) . ') AS tmp'))[0]['count']);
->where("time >= {$start} AND time <= {$end}") . ') AS tmp'))[0]['count']);
$this->overview['uv'][$day]['total'] += $this->overview['uv'][$day]['hours'][$i];
// "SELECT ip FROM {$this->table} {$where} AND `time` BETWEEN {$start} AND {$end}"));
$this->overview['pv'][$day]['hours'][$i] = intval($this->db->fetchAll($this->db->select('COUNT(1) AS count')