piwik 数据库浏览记录存放在piwik_log_visit表中
piwik_log_visit 表有个location_ip字段,该字段存储为Byte[]字节
解析出来后的IP地址为 XXX.XXX.XXX.0 IP地址不全
扩展:
piwik_log_visit中新增location_fullip字段
修改\core\Tracker\Visit.php文件,添加即可
private function setNewVisitorInformation()
{
$idVisitor = $this->getVisitorIdcookie();
$visitorIp = $this->getVisitorIp();
$configId = $this->request->getMetadata('CoreHome', 'visitorId'); $this->visitProperties->clearProperties(); $this->visitProperties->setProperty('idvisitor', $idVisitor);
$this->visitProperties->setProperty('config_id', $configId);
$this->visitProperties->setProperty('location_ip', $visitorIp);
$this->visitProperties->setProperty('location_fullip',$this->request->getIpString());
}