Ignore:
Timestamp:
Nov 10, 2014 10:10:32 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

    r422 r441  
    1111                parent::__construct();
    1212        }
    13         function getSmstemplates($data) {
     13        function getPaidlogs($data) {
    1414        $sql = "SELECT * FROM " . $this->table_name. " INNER JOIN tbluser ON tbluser.us_id = tblpaidlog.us_id ";
    1515        if ($data['keyword']) {
     
    5050    }
    5151
    52     function countSmstemplate($data) {
     52    function countPaidlog($data) {
    5353        $sql = "SELECT COUNT(".$this->id_name.") as total FROM " . $this->table_name;
    5454        if ($data['keyword']) {
     
    6262        return $result['total'];
    6363    }
    64     function getSmstemplate($id)
     64    function getPaidlog($id)
    6565    {
    6666        $sql="SELECT * FROM ".$this->table_name." WHERE ".$this->id_name."=".$id." LIMIT 1";
     
    6868        return $result;
    6969    }
     70    function getAllPaidlogs($from)
     71    {
     72        // get all paidlogs from the last years until now
     73        $from = date("Y-m-d 00:00:00",$from);
     74        $sql="SELECT * FROM ".$this->table_name." WHERE paid_time > '".$from."'";
     75        $result = $this->db->query($sql)->result_array();
     76        foreach ($result as $index=>$paidlog)
     77        {
     78            $result[$index]['time']=  strtotime($paidlog['paid_time']);
     79        }
     80        return $result;
     81    }
    7082}
Note: See TracChangeset for help on using the changeset viewer.