Changeset 764


Ignore:
Timestamp:
Feb 13, 2015 11:21:59 AM (10 years ago)
Author:
quyenla
Message:

fix

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pro-violet-viettel/sourcecode/application/modules/admin/models/reportmodel.php

    r763 r764  
    3434        if (isset($input['to_month']))
    3535        {
    36         $sql = "SELECT *,SUM(amount) as total FROM tblpaidlog LEFT JOIN tbluser ON tbluser.us_id=tblpaidlog.us_id WHERE tblpaidlog.paid_time > '" . $input['to_year'] . "-" . $input['to_month'] . "-".$input['to_date']." 00:00:00' AND  tblpaidlog.paid_time <'" . $input['to_year'] . "-" . $input['to_month'] . "-".$input['to_date']." 23:59:59'  GROUP BY tbluser.province";
     36        $sql = "SELECT *,SUM(amount) as total FROM tblpaidlog LEFT JOIN tbluser ON tbluser.us_id=tblpaidlog.us_id WHERE tblpaidlog.paid_time >= '" . $input['to_year'] . "-" . $input['to_month'] . "-".$input['to_date']." 00:00:00' AND  tblpaidlog.paid_time <= '" . $input['to_year'] . "-" . $input['to_month'] . "-".$input['to_date']." 23:59:59'  GROUP BY tbluser.province";
    3737        }
    3838        $query = $this->db->query($sql);
     
    4040
    4141        // Tinh thue bao theo tinh theo nam
    42         $sql = "SELECT *,count(us_id) as total FROM tbluser WHERE tbluser.created_time >'" . $input['year'] . "-01-01' AND tbluser.created_time <'" . ($input['year'] + 1) . "-01-01' GROUP BY tbluser.province";
     42        $sql = "SELECT *,count(us_id) as total FROM tbluser WHERE tbluser.created_time >= '" . $input['year'] . "-01-01' AND tbluser.created_time <= '" . ($input['year'] + 1) . "-01-01' GROUP BY tbluser.province";
    4343        $query = $this->db->query($sql);
    4444        $tbns = $query->result_array();
     
    5050       
    5151         // tinh thue bao theo ngay
    52         $sql = "SELECT *,count(us_id) as total FROM tbluser WHERE tbluser.created_time >'" . $input['to_year'] . "-" . $input['to_month'] . "-".$input['to_date']." 00:00:00' AND tbluser.created_time < '" . $input['to_year'] . "-" . $input['to_month'] . "-".$input['to_date']." 23:59:59'  GROUP BY tbluser.province";
     52        $sql = "SELECT *,count(us_id) as total FROM tbluser WHERE tbluser.created_time >='" . $input['to_year'] . "-" . $input['to_month'] . "-".$input['to_date']." 00:00:00' AND tbluser.created_time <= '" . $input['to_year'] . "-" . $input['to_month'] . "-".$input['to_date']." 23:59:59'  GROUP BY tbluser.province";
    5353       
    5454        $query = $this->db->query($sql);
Note: See TracChangeset for help on using the changeset viewer.