|
@@ -74,35 +74,40 @@ class Index extends AppadminbaseBlock implements AppadminbaseBlockInterface
|
|
$three_day_array = array();
|
|
$three_day_array = array();
|
|
$seven_day_array = array();
|
|
$seven_day_array = array();
|
|
|
|
|
|
- $seven_where = " where user_from_time >= '$seven_tjtime' ";
|
|
|
|
- $three_where = " where user_from_time >= '$three_tjtime' ";
|
|
|
|
- $one_where = " where user_from_time >= '$today_tjtime' ";
|
|
|
|
|
|
+ $seven_where = " where user_from_time >= '$seven_tjtime' and user_browser != 'unknown' ";
|
|
|
|
+ $three_where = " where user_from_time >= '$three_tjtime' and user_browser != 'unknown' ";
|
|
|
|
+ $one_where = " where user_from_time >= '$today_tjtime' and user_browser != 'unknown' ";
|
|
|
|
|
|
|
|
|
|
# 得到 统计数组。
|
|
# 得到 统计数组。
|
|
- $seven_sql = "select user_ip,user_from_time,count(user_ip) as ip_num from $table $seven_where group by user_ip order by user_ip desc";
|
|
|
|
|
|
+ $seven_sql = "select user_ip,user_from_time,user_from_url,count(user_ip) as ip_num from $table $seven_where group by user_ip order by user_ip desc";
|
|
$seven_day_array = $db->createCommand($seven_sql,[])->queryAll();
|
|
$seven_day_array = $db->createCommand($seven_sql,[])->queryAll();
|
|
|
|
|
|
- $three_sql = "select user_ip,user_from_time,count(user_ip) as ip_num from $table $three_where group by user_ip order by user_ip desc ";
|
|
|
|
|
|
+ $three_sql = "select user_ip,user_from_time,user_from_url,count(user_ip) as ip_num from $table $three_where group by user_ip order by user_ip desc ";
|
|
$three_day_array = $db->createCommand($three_sql,[])->queryAll();
|
|
$three_day_array = $db->createCommand($three_sql,[])->queryAll();
|
|
|
|
|
|
- $one_sql = "select user_ip,user_from_time,count(user_ip) as ip_num from $table $one_where group by user_ip order by user_ip desc ";
|
|
|
|
|
|
+ $one_sql = "select user_ip,user_from_time,user_from_url,count(user_ip) as ip_num from $table $one_where group by user_ip order by user_ip desc ";
|
|
$one_day_array = $db->createCommand($one_sql,[])->queryAll();
|
|
$one_day_array = $db->createCommand($one_sql,[])->queryAll();
|
|
|
|
|
|
$created_at_lt = $this->_param['user_from_time_lt'];
|
|
$created_at_lt = $this->_param['user_from_time_lt'];
|
|
$created_at_gte = $this->_param['user_from_time_gte'];
|
|
$created_at_gte = $this->_param['user_from_time_gte'];
|
|
$where = [];
|
|
$where = [];
|
|
|
|
|
|
- if($created_at_lt)
|
|
|
|
|
|
+ if($created_at_lt){
|
|
$where []= " user_from_time < '$created_at_lt' ";
|
|
$where []= " user_from_time < '$created_at_lt' ";
|
|
- if($created_at_gte)
|
|
|
|
|
|
+ }
|
|
|
|
+ if($created_at_gte){
|
|
$where []= " user_from_time >= '$created_at_gte' ";
|
|
$where []= " user_from_time >= '$created_at_gte' ";
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ $where []= " user_browser != 'unknown' ";
|
|
|
|
+
|
|
if(!empty($where)){
|
|
if(!empty($where)){
|
|
$where = ' where '.implode(' and ',$where);
|
|
$where = ' where '.implode(' and ',$where);
|
|
}else{
|
|
}else{
|
|
$where = '';
|
|
$where = '';
|
|
}
|
|
}
|
|
- $period_sql = "select user_ip,user_from_time,count(user_ip) as ip_num from $table $where group by user_ip";
|
|
|
|
|
|
+ $period_sql = "select user_ip,user_from_time,user_from_url,count(user_ip) as ip_num from $table $where group by user_ip";
|
|
$period_data = $db->createCommand($period_sql,[])->queryAll();
|
|
$period_data = $db->createCommand($period_sql,[])->queryAll();
|
|
|
|
|
|
$str = '<div class="tj">IP只显示访问三次及以上的</div>';
|
|
$str = '<div class="tj">IP只显示访问三次及以上的</div>';
|
|
@@ -115,6 +120,11 @@ class Index extends AppadminbaseBlock implements AppadminbaseBlockInterface
|
|
}
|
|
}
|
|
$str .= " <a href='#' class='dd_ip'>";
|
|
$str .= " <a href='#' class='dd_ip'>";
|
|
$str .= $o_v['user_ip']."</a>(".$o_v['ip_num']."次)";
|
|
$str .= $o_v['user_ip']."</a>(".$o_v['ip_num']."次)";
|
|
|
|
+ $laiyuan = substr($o_v['user_from_url'],0,25);
|
|
|
|
+
|
|
|
|
+ if(!strpos($laiyuan,'queenabby')){
|
|
|
|
+ $str .= "<span style='color: red'>来源(".$laiyuan."...)</span>";
|
|
|
|
+ }
|
|
$one_num++;
|
|
$one_num++;
|
|
}
|
|
}
|
|
$str .= "</div>";
|
|
$str .= "</div>";
|
|
@@ -128,6 +138,11 @@ class Index extends AppadminbaseBlock implements AppadminbaseBlockInterface
|
|
}
|
|
}
|
|
$str .= " <a href='#' class='dd_ip'>";
|
|
$str .= " <a href='#' class='dd_ip'>";
|
|
$str .= $o_v['user_ip']."</a>(".$o_v['ip_num']."次)";
|
|
$str .= $o_v['user_ip']."</a>(".$o_v['ip_num']."次)";
|
|
|
|
+ $laiyuan = substr($o_v['user_from_url'],0,25);
|
|
|
|
+
|
|
|
|
+ if(!strpos($laiyuan,'queenabby')){
|
|
|
|
+ $str .= "<span style='color: red'>来源(".$laiyuan."...)</span>";
|
|
|
|
+ }
|
|
$three_num++;
|
|
$three_num++;
|
|
}
|
|
}
|
|
$str .= "</div>";
|
|
$str .= "</div>";
|
|
@@ -141,6 +156,13 @@ class Index extends AppadminbaseBlock implements AppadminbaseBlockInterface
|
|
}
|
|
}
|
|
$str .= " <a href='#' class='dd_ip'>";
|
|
$str .= " <a href='#' class='dd_ip'>";
|
|
$str .= $o_v['user_ip']."</a>(".$o_v['ip_num']."次)";
|
|
$str .= $o_v['user_ip']."</a>(".$o_v['ip_num']."次)";
|
|
|
|
+
|
|
|
|
+ $laiyuan = substr($o_v['user_from_url'],0,25);
|
|
|
|
+
|
|
|
|
+ if(!strpos($laiyuan,'queenabby')){
|
|
|
|
+ $str .= "<span style='color: red'>来源(".$laiyuan."...)</span>";
|
|
|
|
+ }
|
|
|
|
+
|
|
$seven_num++;
|
|
$seven_num++;
|
|
}
|
|
}
|
|
$str .= "</div>";
|
|
$str .= "</div>";
|
|
@@ -155,6 +177,14 @@ class Index extends AppadminbaseBlock implements AppadminbaseBlockInterface
|
|
}
|
|
}
|
|
$str .= " <a href='#' class='dd_ip'>";
|
|
$str .= " <a href='#' class='dd_ip'>";
|
|
$str .= $o_v['user_ip']."</a>(".$o_v['ip_num']."次)";
|
|
$str .= $o_v['user_ip']."</a>(".$o_v['ip_num']."次)";
|
|
|
|
+
|
|
|
|
+ $laiyuan = substr($o_v['user_from_url'],0,25);
|
|
|
|
+
|
|
|
|
+ if(!strpos($laiyuan,'queenabby')){
|
|
|
|
+ $str .= "<span style='color: red'>来源(".$laiyuan."...)</span>";
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
$period_num++;
|
|
$period_num++;
|
|
}
|
|
}
|
|
$str .= "</div>";
|
|
$str .= "</div>";
|
|
@@ -251,15 +281,22 @@ class Index extends AppadminbaseBlock implements AppadminbaseBlockInterface
|
|
$created_at_lt = $this->_param['user_from_time_lt'];
|
|
$created_at_lt = $this->_param['user_from_time_lt'];
|
|
$created_at_gte = $this->_param['user_from_time_gte'];
|
|
$created_at_gte = $this->_param['user_from_time_gte'];
|
|
$where = [];
|
|
$where = [];
|
|
- if($user_ip)
|
|
|
|
- $where []= " user_ip = '$user_ip' ";
|
|
|
|
- if($user_from_url)
|
|
|
|
- $where []= " user_from_url like '%$user_from_url%' ";
|
|
|
|
-
|
|
|
|
- if($created_at_lt)
|
|
|
|
- $where []= " user_from_time < '$created_at_lt' ";
|
|
|
|
- if($created_at_gte)
|
|
|
|
- $where []= " user_from_time >= '$created_at_gte' ";
|
|
|
|
|
|
+ if($user_ip){
|
|
|
|
+ $where []= " user_ip = '$user_ip' ";
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if($user_from_url){
|
|
|
|
+ $where []= " user_from_url like '%$user_from_url%' ";
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if($created_at_lt){
|
|
|
|
+ $where []= " user_from_time < '$created_at_lt' ";
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if($created_at_gte){
|
|
|
|
+ $where []= " user_from_time >= '$created_at_gte' ";
|
|
|
|
+ }
|
|
|
|
+ $where []= " user_browser != 'unknown' ";
|
|
if(!empty($where)){
|
|
if(!empty($where)){
|
|
$where = ' where '.implode(' and ',$where);
|
|
$where = ' where '.implode(' and ',$where);
|
|
}else{
|
|
}else{
|