Beispiel #1
0
 /**
  * 
  * @return array
  */
 public function getDatasetUsers()
 {
     $cacheKey = 'percentile/users_connections/' . ($this->account ? $this->account->getName() : '');
     return $this->cacheGet($cacheKey, function () {
         $array = $this->cacheGet('rawpercentile/users_connections', function () {
             $conn = User::getConnection();
             $sql = "SELECT " . time() . " - `lastaccess` as n FROM `tokens` ORDER BY n";
             $array = [];
             foreach ($conn->query($sql) as $row) {
                 $array[] = floor($row['n'] / 86400);
             }
             return $array;
         }, 3600);
         return $this->doCalcPercentiles($array);
     }, 900);
 }