Ignore:
Timestamp:
Feb 22, 2016, 10:09:57 AM (4 years ago)
Author:
mabarracus
Message:

Fixed bugs: Current month is not displayed, rotation stops when year change

Location:
lliurex-analytics-server/trunk/fuentes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • lliurex-analytics-server/trunk/fuentes/debian/changelog

    r352 r699  
     1lliurex-analytics-server (0.0.5) xenial; urgency=medium
     2
     3  * Fixed bugs: Current month is not displayed, rotation stops when year change.
     4
     5 -- M.Angel Juan <m.angel.juan@gmail.com>  Mon, 22 Feb 2016 10:00:49 +0100
     6
    17lliurex-analytics-server (0.0.4) xenial; urgency=medium
    28
  • lliurex-analytics-server/trunk/fuentes/lliurex-analytics-server/usr/lib/analytics-server/analytics/db.php

    r350 r699  
    6666        function rotate(){
    6767            $sql="select max(fecha) from historico;";
    68             $thismonth=intval(date("m"));
     68            $thismonth=intval(date("Ym"));
    6969            $lastmonth=$thismonth;
    7070            if ($result=$this->dbconn->query($sql)){
     
    7878                        $query->close();
    7979                    }else{
    80                         $lastmonth=intval(explode('-',$row[0])[1]);
     80                        $lastmonth=intval(explode('-',$row[0])[0].explode('-',$row[0])[1]);
    8181                    }
    8282                }
     
    9999                //echo $today.' '.$first_this_month.' '.$first_one_month_ago.' '.$last_one_month_ago.' '.$first_two_month_ago.' '.$last_two_month_ago.' EOL';
    100100                $obj=[];
    101                 $sql="SELECT app,count,fecha from historico where fecha BETWEEN '$first_this_month' and '$today' order by count DESC LIMIT 30";
     101                $sql="SELECT app,count from packages UNION SELECT app,count from historico where fecha BETWEEN '$first_this_month' and '$today' order by count DESC LIMIT 30";
    102102                if ($result=$this->dbconn->query($sql)){
    103103                        $obj2=[];
Note: See TracChangeset for help on using the changeset viewer.