Changeset 757
- Timestamp:
- Feb 10, 2015 4:08:39 PM (10 years ago)
- Location:
- pro-violet-viettel/sourcecode/application/modules/admin
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
pro-violet-viettel/sourcecode/application/modules/admin/controllers/reportprovince.php
r756 r757 95 95 $writer->save('php://output'); 96 96 } 97 98 99 97 } -
pro-violet-viettel/sourcecode/application/modules/admin/models/reportmodel.php
r755 r757 16 16 17 17 function getProvinces($input) { 18 18 $ext=""; 19 if (isset($input['to_month'])) 20 { 21 $ext="AND tblpaidlog.paid_time <'" . $input['to_year'] . "-" . $input['to_month'] . "-01 23:59:59'"; 22 } 19 23 $provinces = lang('_PROVINCES_'); 20 24 // Tinh doanh thu theo tinh theo nam … … 23 27 $dtns = $query->result_array(); 24 28 // tinh doanh thu theo thang 25 $sql = "SELECT *,SUM(amount) as total FROM tblpaidlog LEFT JOIN tbluser ON tbluser.us_id=tblpaidlog.us_id WHERE tblpaidlog.paid_time >'" . $input['year'] . "-" . $input['month'] . "-01' GROUP BY tbluser.province";29 $sql = "SELECT *,SUM(amount) as total FROM tblpaidlog LEFT JOIN tbluser ON tbluser.us_id=tblpaidlog.us_id WHERE tblpaidlog.paid_time >'" . $input['year'] . "-" . $input['month'] . "-01' $ext GROUP BY tbluser.province"; 26 30 $query = $this->db->query($sql); 27 31 $dtts = $query->result_array(); 28 32 // tinh doanh thu trong ngay hien tai 29 33 $sql = "SELECT *,SUM(amount) as total FROM tblpaidlog LEFT JOIN tbluser ON tbluser.us_id=tblpaidlog.us_id WHERE tblpaidlog.paid_time > '" . date('Y') . "-" . date('m') . "-".date('d')." 00:00:00' AND tblpaidlog.paid_time <'" . date('Y') . "-" . date('m') . "-".date('d')." 23:59:59' GROUP BY tbluser.province"; 30 34 if (isset($input['to_month'])) 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"; 37 } 31 38 $query = $this->db->query($sql); 32 39 $dtng = $query->result_array(); … … 38 45 39 46 // tinh thue bao theo thang 40 $sql = "SELECT *,count(us_id) as total FROM tbluser WHERE tbluser.created_time >'" . $input['year'] . "-" . $input['month'] . "-01' GROUP BY tbluser.province";47 $sql = "SELECT *,count(us_id) as total FROM tbluser WHERE tbluser.created_time >'" . $input['year'] . "-" . $input['month'] . "-01' $ext GROUP BY tbluser.province"; 41 48 $query = $this->db->query($sql); 42 49 $tbts = $query->result_array(); … … 44 51 // tinh thue bao theo ngay 45 52 $sql = "SELECT *,count(us_id) as total FROM tbluser WHERE tbluser.created_time >'" . date('Y') . "-" . date('m') . "-".date('d')." 00:00:00' AND tbluser.created_time < '" . date('Y') . "-" . date('m') . "-".date('d')." 23:59:59' GROUP BY tbluser.province"; 53 if (isset($input['to_month'])) 54 { 55 $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"; 56 } 46 57 $query = $this->db->query($sql); 47 58 $tbng = $query->result_array(); … … 154 165 //$input['month']=1; 155 166 //$input['year']=2014; 167 //$input['to_month']=1; 168 //$input['to_year']=2015; 169 //$input['to_date']=15; 156 170 $data=$this->getProvinces($input); 157 171 return $data; … … 159 173 public function exportPackage($input) 160 174 { 161 //$input['month']=1;162 //svn $input['year']=2014;175 //$input['month']=1; 176 //svn $input['year']=2014; 163 177 $data=$this->getPackages($input); 164 178 return $data;
Note: See TracChangeset
for help on using the changeset viewer.