开源移动应用统计分析系统Cobub Razor安装踩坑记录
为兼容PHP 7,修改文件
- 1、/system/core/Router.php
if (is_dir(APPPATH . 'controllers/' . $segments[0])) {
//2018-01-03 AppBlog.CN
$temp = array('dir' => array(), 'number' => 0, 'path' => '');
$temp['number'] = count($segments) - 1;
- 2、/application/models/PasswordHash.php
//function PasswordHash ($iteration_count_log2, $portable_hashes)
//2018-01-03 AppBlog.CN
function __construct($iteration_count_log2, $portable_hashes)
{
- 3、/application/libraries/phpass-0.1/PasswordHash.php
//function PasswordHash($iteration_count_log2, $portable_hashes)
//2018-01-03 AppBlog.CN
function __construct($iteration_count_log2, $portable_hashes)
{
若出现错误:Table 'applog_db.razor_users' doesn't exist
参考:https://github.com/cobub/razor/issues/11
首先删除:applog_db和applog_dw中的所有表,然后分别导入/assets/sql/dbtables.sql和/assets/sql/dwtables.sql
在导入dbtables.sql和dwtables.sql前,需要进行如下修改
-
1、修改dbtables.sql和dwtables.sql的表前缀为razor_
-
2、修改dbtables.sql的users表创建脚本
CREATE TABLE IF NOT EXISTS `razor_users` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`username` varchar(50) COLLATE utf8_bin NOT NULL,
`password` varchar(255) COLLATE utf8_bin NOT NULL,
`email` varchar(100) COLLATE utf8_bin NOT NULL,
`activated` tinyint(1) NOT NULL DEFAULT '1',
`banned` tinyint(1) NOT NULL DEFAULT '0',
`ban_reason` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`new_password_key` varchar(50) COLLATE utf8_bin DEFAULT NULL,
`new_password_requested` datetime DEFAULT NULL,
`new_email` varchar(100) COLLATE utf8_bin DEFAULT NULL,
`new_email_key` varchar(50) COLLATE utf8_bin DEFAULT NULL,
`last_ip` varchar(40) COLLATE utf8_bin NOT NULL,
`last_login` datetime,
`created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`sessionkey` varchar(50) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
- 3、删除dbtables.sql中
--$$
这一行
--$$
INSERT INTO `razor_user_permissions` VALUES
继续安装直至完成
若 我的应用 页面不能打开,出现如下错误
Expression #2 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'applog_dw.pp.newusers' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
解决方案参考:http://blog.csdn.net/qq_34707744/article/details/78031413
若 我的应用 页面报错:A non well formed numeric value encountered
修改文件:report/console.php
for ($i = 0; $i < count($this->_data['androidList']); $i ++) {
$row = $this->_data['androidList'][$i];
$this->_data['today_startuser'] += $row['startUserToday'];
$this->_data['yestoday_startuser'] += intval($row['startUserYestoday']);
$this->_data['today_newuser'] += $row['newUserToday'];
$this->_data['yestoday_newuser'] += intval($row['newUserYestoday']);
$this->_data['today_startcount'] += $row['startCountToday'];
$this->_data['yestoday_startcount'] += intval($row['startCountYestoday']);
$this->_data['today_totaluser'] += $row['totaluser'];
}
若指定应用 转化率 页面报错
application/models/conversion/conversionmodel.php
function getConversionListByProductIdAndUserId($productid, $userid, $fromdate, $todate, $version = '')
{
$dwdb = $this->load->database('dw', true);
统计图表数据不显示
(1)application/models/product/errormodel.php
两处 pp.version_name = $version_name
改为 pp.version_name = '$version_name'
(2)application/controllers/report/productbasic.php
$ret["timeTick"] = $this -> common -> getTimeTick($toTime - $fromTime);
改为
$ret["timeTick"] = $this -> common -> getTimeTick(intval($toTime) - intval($fromTime));
(3)application/controllers/report/console.php
$ret["timeTick"] = $this->common->getTimeTick($toTime - $fromTime);
改为
$ret["timeTick"] = $this->common->getTimeTick(intval($toTime) - intval($fromTime));
版权声明:
作者:Joe.Ye
链接:https://www.appblog.cn/index.php/2023/03/19/open-source-mobile-application-statistical-analysis-system-cobub-razor-installation/
来源:APP全栈技术分享
文章版权归作者所有,未经允许请勿转载。
共有 0 条评论