This commit is contained in:
44
app/Models/interest/RatesModel.php
Normal file
44
app/Models/interest/RatesModel.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
namespace App\Models\interest;
|
||||
|
||||
use CodeIgniter\Model;
|
||||
|
||||
class RatesModel extends Model
|
||||
{
|
||||
|
||||
public function getLists()
|
||||
{
|
||||
|
||||
$builder = $this->db->table("tb_lender AS a");
|
||||
|
||||
$builder->select("a.seq
|
||||
, IFNULL(CASE
|
||||
WHEN a.bank_type = 'B' THEN (SELECT cd_nm FROM codes WHERE cd = a.bank AND category = 'BANK')
|
||||
WHEN a.bank_type = 'I' THEN (SELECT cd_nm FROM codes WHERE cd = a.bank AND category = 'INSURANCE') END, a.bank_nm) AS bank
|
||||
, a.bank_type
|
||||
, a.product
|
||||
, a.tel
|
||||
, a.min_rate
|
||||
, a.avg_rate
|
||||
, a.max_rate
|
||||
, a.chg_yn
|
||||
, a.split_yn
|
||||
, b.extra_fee
|
||||
, b.late_rate
|
||||
, b.join_method
|
||||
, b.prepay_fee
|
||||
, b.loan_limit
|
||||
, IFNULL(DATE_FORMAT(b.prov_date, '%Y-%m-%d'), '') AS prov_date");
|
||||
|
||||
$builder->join("tbl_lender_dtl AS b", "b.seq = a.seq", "LEFT");
|
||||
|
||||
|
||||
$builder->where("a.use_yn", "Y");
|
||||
|
||||
|
||||
// $builder->orderBy('a.seq', 'DESC');
|
||||
|
||||
return $builder->get()->getResultArray();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user