Changeset 764
- Timestamp:
- Feb 13, 2015 11:21:59 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pro-violet-viettel/sourcecode/application/modules/admin/models/reportmodel.php
r763 r764 34 34 if (isset($input['to_month'])) 35 35 { 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"; 37 37 } 38 38 $query = $this->db->query($sql); … … 40 40 41 41 // 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"; 43 43 $query = $this->db->query($sql); 44 44 $tbns = $query->result_array(); … … 50 50 51 51 // 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"; 53 53 54 54 $query = $this->db->query($sql);
Note: See TracChangeset
for help on using the changeset viewer.