mirror of
https://github.com/tursom/typecho-plugin-Access.git
synced 2024-12-28 05:40:40 +08:00
修复今日图表中 UV 和 IP 折线永远相同的问题
UV 查询错误地使用了 IP 的子查询
This commit is contained in:
parent
60dff2ec7d
commit
2f7b8e6eaa
@ -184,8 +184,12 @@ class Access_Core
|
||||
}
|
||||
$this->overview['ip'][$day]['hours'][$i] = intval($this->db->fetchAll($this->db->select('COUNT(1) AS count')
|
||||
->from('(' . $subQuery . ') AS tmp'))[0]['count']);
|
||||
|
||||
// "SELECT DISTINCT ip,ua FROM {$this->table} {$where} AND `time` BETWEEN {$start} AND {$end}"));
|
||||
$subQuery = $this->db->select('DISTINCT ip,ua')->from('table.access_log')
|
||||
->where("time >= ? AND time <= ?", $start, $end);
|
||||
if (method_exists($subQuery, 'prepare')) {
|
||||
$subQuery = $subQuery->prepare($subQuery);
|
||||
}
|
||||
$this->overview['uv'][$day]['hours'][$i] = intval($this->db->fetchAll($this->db->select('COUNT(1) AS count')
|
||||
->from('(' . $subQuery . ') AS tmp'))[0]['count']);
|
||||
// "SELECT ip FROM {$this->table} {$where} AND `time` BETWEEN {$start} AND {$end}"));
|
||||
|
Loading…
Reference in New Issue
Block a user