Browse Source

登录页加入返回首页

541469799@qq.com 8 tháng trước cách đây
mục cha
commit
a346ebf4df
2 tập tin đã thay đổi với 3 bổ sung3 xóa
  1. 2 0
      app/index/controller/User.php
  2. 1 3
      app/index/model/user/UserAccessLog.php

+ 2 - 0
app/index/controller/User.php

@@ -999,6 +999,8 @@ class User extends Controller
 
         $data = [];
 
+        $data['distinct_ip_cnt'] = UserAccessLog::getAccessLogDistinctIps($from,time());
+
         while ($from < time()){
             $to = $from + 86399;
             $data[date('Y-m-d',$from)] = UserAccessLog::getAccessLogPathes($from,$to);

+ 1 - 3
app/index/model/user/UserAccessLog.php

@@ -62,9 +62,7 @@ class UserAccessLog extends UserAccessLogModel
 
     public static function getAccessLogDistinctIps($from, $to)
     {
-            $res[$item] = self::where('create_time', '>=', $from)->where('create_time', '<=', $to)->count('distinct ip');
-
-        return $res;
+        return self::where('create_time', '>=', $from)->where('create_time', '<=', $to)->count('distinct ip');
     }
 
 }