Ignore:
Timestamp:
Nov 10, 2014 11:07:50 AM (11 years ago)
Author:
quyenla
Message:

paidlogs

File:
1 edited

Legend:

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

    r441 r442  
    1010        {
    1111                parent::__construct();
     12
    1213        }
    1314        function getPaidlogs($data) {
     
    1516        if ($data['keyword']) {
    1617            if ($data['search_field'] == "cellphone") {
    17                 $sql.=" WHERE (service_id LIKE '%" . $data['keyword'] . "%')";
    18             } else {
    19                 $sql.=" WHERE (sms_content LIKE '%" . $data['keyword'] . "%' OR sms_reply LIKE '%" . $data['keyword'] . "%') ";
    20             }
     18                $sql.=" WHERE (cellphone LIKE '%" . $data['keyword'] . "%')";
     19            }
    2120        }
    2221
     
    5150
    5251    function countPaidlog($data) {
    53         $sql = "SELECT COUNT(".$this->id_name.") as total FROM " . $this->table_name;
     52        $sql = "SELECT COUNT(".$this->id_name.") as total FROM " . $this->table_name." INNER JOIN tbluser ON tbluser.us_id = tblpaidlog.us_id";
    5453        if ($data['keyword']) {
    5554            if ($data['search_field'] == "cellphone") {
    56                 $sql.=" WHERE (service_id LIKE '%" . $data['keyword'] . "%')";
    57             } else {
    58                 $sql.=" WHERE (sms_content LIKE '%" . $data['keyword'] . "%' OR sms_reply LIKE '%" . $data['keyword'] . "%') ";
    59             }
     55                $sql.=" WHERE (cellphone LIKE '%" . $data['keyword'] . "%')";
     56            }
    6057        }
     58       
    6159        $result = $this->db->query($sql)->row_array();
    6260        return $result['total'];
Note: See TracChangeset for help on using the changeset viewer.