53b71268 by Zelig

贷后 还款管理 编辑

1 parent 5d4817be
......@@ -45,11 +45,20 @@ class Loan extends CI_Controller {
}
}
public function edit($state = 1)
public function edit($state = 1, $id = null)
{
$this->load->driver('enum');
$this->load->driver('configure');
switch ($state) {
case 1:
$this->load->view('/loan/还款编辑');
$url = $this->config->item('apiBaseUrl') . 'loanAfter/repaymentPlan/'.$id;
$result = file_get_contents($url);
$json = json_decode($result);
$ret = $json->data;
$ret->enumRepayStatus = $this->enum->repaymentPlan->status();
$this->load->view('/loan/还款编辑', $ret);
break;
case 2:
$this->load->view('/loan/催收编辑');
......
......@@ -348,4 +348,4 @@ class CheckLogin
}
}
}
\ No newline at end of file
}
......
<?php
class Configure extends CI_Driver_Library {
public function __construct () {
$this->valid_drivers = ['enum'];
}
}
<?php
class Configure_enum extends CI_Driver
{
public $CI;
public function __construct () {
$this->CI = &get_instance();
}
public function repayment () {
$url = $this->CI->config->item('apiBaseUrl') . 'config/enum/repayment';
$result = file_get_contents($url);
$json = json_decode($result);
$ret = $json->data;
return $ret;
}
}
<?php
class Enum extends CI_Driver_Library {
public function __construct () {
$this->valid_drivers = ['repaymentPlan'];
}
}
<?php
class Enum_repaymentPlan extends CI_Driver
{
public $CI;
public function __construct () {
$this->CI = &get_instance();
}
public function status () {
$url = $this->CI->config->item('apiBaseUrl') . 'enum/repaymentPlan/status';
$result = file_get_contents($url);
$json = json_decode($result);
$ret = $json->data;
return $ret;
}
public function source () {
$url = $this->CI->config->item('apiBaseUrl') . 'enum/repaymentPlan/source';
$result = file_get_contents($url);
$json = json_decode($result);
$ret = $json->data;
return $ret;
}
}
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!