Ignore:
Timestamp:
Mar 3, 2015 4:43:43 PM (10 years ago)
Author:
namnd
Message:
 
File:
1 edited

Legend:

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

    r767 r777  
    1313        }
    1414        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'];
    1522        $sql = "SELECT * FROM " . $this->table_name. " INNER JOIN tbluser ON tbluser.us_id = tblpaidlog.us_id ";
    1623                if ($data['paid_type'] == 1){
     
    4754        }
    4855        $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;
    5061    }
    5162
Note: See TracChangeset for help on using the changeset viewer.