i have used this model before and it used to work and now i don't know why $this->db->distinct(); isn't working.
if($this->input->post('Status'))
{
$this->db->where('Status', $this->input->post('Status'));
}
if($this->input->post('PlateNo'))
{
$this->db->like('PlateNo', $this->input->post('PlateNo'));
}
if($this->input->post('user.userId'))
{
$this->db->like('user.userId', $this->input->post('user.userId'));
}
$this->db->select('*');
$this->db->distinct();
$this->db->from($this->table);
$this->db->join('user', 'user.userId = loanapplication.userId', 'left');
$this->db->join('loanrequest', 'loanrequest.ApplicationNo = loanapplication.ApplicationNo', 'left');
$this->db->join('loanapproval', 'loanapproval.RequestNo = loanrequest.RequestNo', 'left');
$this->db->join('collateraldetails', 'collateraldetails.ApplicationNo = loanapplication.ApplicationNo', 'left');
$this->db->join('paymentdetails', 'paymentdetails.ApplicationNo = loanapplication.ApplicationNo', 'left');
$this->db->join('loanpayment', 'loanpayment.PaymentId = paymentdetails.PaymentId', 'left');
$this->db->join('vehicleinformation', 'vehicleinformation.vehicleNo = collateraldetails.vehicleNo', 'left');