File: /var/www/html/taxicamera/old/applicationold/models/admin/Mdriverrefundsettlement.php
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Mdriverrefundsettlement extends CI_Model {
public function __construct() {
parent::__construct();
}
public function GetDriverRefundSettlement($table,$condition){
$result = array();
$this->db->select('*');
$this->db->from($table);
$this->db->where($condition);
$this->db->order_by('dr_refund_settlement_id','desc');
$this->db->limit('1');
$query = $this->db->get();
$result = $query->row_array();
return $result;
}
public function totalRefund($table,$condition){
$result = array();
$total_refund = 0.00;
$this->db->select('sum(refund_amt) as total_refund');
$this->db->from($table);
$this->db->where($condition);
$query = $this->db->get();
//echo $this->db->last_query();exit();
$result = $query->row_array();
if(!empty($result) && !empty($result['total_refund'])){
$total_refund = $result['total_refund'];
}
return $total_refund;
}
}