- Timestamp:
- Mar 3, 2015 4:43:43 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pro-violet-viettel/sourcecode/application/modules/admin/models/paidlog_model.php
r767 r777 13 13 } 14 14 function getPaidlogs($data) { 15 if ($data['paid_type'] == 0){ 16 $sql = "SELECT SUM(amount) as total_amount FROM tblpaidlog"; 17 }else{ 18 $sql = "SELECT SUM(amount) as total_amount FROM tblpaidlog WHERE paid_type = ".$data['paid_type']; 19 } 20 $r = $this->db->query($sql)->row_array(); 21 $total_amount = (int)$r['total_amount']; 15 22 $sql = "SELECT * FROM " . $this->table_name. " INNER JOIN tbluser ON tbluser.us_id = tblpaidlog.us_id "; 16 23 if ($data['paid_type'] == 1){ … … 47 54 } 48 55 $sql=$sql . " " . $order . " LIMIT " . $data['start'] . ", " . $data['perpage'] . " "; 49 return $this->db->query($sql)->result_array(); 56 //return $this->db->query($sql)->result_array(); 57 $re = $this->db->query($sql)->result_array(); 58 $result['paid_logs'] = $re; 59 $result['total_amount'] = $total_amount; 60 return $result; 50 61 } 51 62
Note: See TracChangeset
for help on using the changeset viewer.