cee4fe99 by yangjianbin

init

1 parent 7aab96d5
...@@ -79,6 +79,13 @@ class CheckLogin ...@@ -79,6 +79,13 @@ class CheckLogin
79 if (!$session->genderEnum) { 79 if (!$session->genderEnum) {
80 $session->genderEnum = $this->getGenderEnum(); 80 $session->genderEnum = $this->getGenderEnum();
81 } 81 }
82
83 if (!$session->loanUseEnum) {
84 $session->loanUseEnum = $this->getLoanUseEnum();
85 }
86 if (!$session->loanNatureEnum) {
87 $session->loanNatureEnum = $this->getLoanNatureEnum();
88 }
82 /*if (preg_match("/admin|base/i", uri_string())) { 89 /*if (preg_match("/admin|base/i", uri_string())) {
83 if(!$this->CI->session->isadmin){ 90 if(!$this->CI->session->isadmin){
84 redirect('login'); 91 redirect('login');
...@@ -302,4 +309,28 @@ class CheckLogin ...@@ -302,4 +309,28 @@ class CheckLogin
302 } 309 }
303 } 310 }
304 311
312 private function getLoanUseEnum()
313 {
314 try {
315 $url = $this->CI->config->item('apiBaseUrl') . 'enum/loan/use';
316 $res = json_decode(file_get_contents($url));
317 $products = $res->data;
318 return $products;
319 } catch (Exception $e) {
320 return array();
321 }
322 }
323
324 private function getLoanNatureEnum()
325 {
326 try {
327 $url = $this->CI->config->item('apiBaseUrl') . 'enum/loan/nature';
328 $res = json_decode(file_get_contents($url));
329 $products = $res->data;
330 return $products;
331 } catch (Exception $e) {
332 return array();
333 }
334 }
335
305 } 336 }
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -348,7 +348,7 @@ ...@@ -348,7 +348,7 @@
348 <div class="form-group col-sm-3 col-md-2"> 348 <div class="form-group col-sm-3 col-md-2">
349 <label>还款方式</label> 349 <label>还款方式</label>
350 <span class="form-control select-box"> 350 <span class="form-control select-box">
351 <select class="select" size="1"> 351 <select class="select" size=c"1">
352 <option value="1"></option> 352 <option value="1"></option>
353 </select> 353 </select>
354 </span> 354 </span>
...@@ -357,7 +357,9 @@ ...@@ -357,7 +357,9 @@
357 <label>贷款用途</label> 357 <label>贷款用途</label>
358 <span class="form-control select-box"> 358 <span class="form-control select-box">
359 <select class="select" size="1"> 359 <select class="select" size="1">
360 <option value="1"></option> 360 <?php foreach ($this->session->loanUseEnum as $k=>$v):?>
361 <option value="<?=$k?>"><?=$v?></option>
362 <?php endforeach;?>
361 </select> 363 </select>
362 </span> 364 </span>
363 </div> 365 </div>
...@@ -381,7 +383,9 @@ ...@@ -381,7 +383,9 @@
381 <label>贷款用途性质</label> 383 <label>贷款用途性质</label>
382 <span class="form-control select-box"> 384 <span class="form-control select-box">
383 <select class="select" size="1"> 385 <select class="select" size="1">
384 <option value="1"></option> 386 <?php foreach ($this->session->loanNatureEnum as $k=>$v):?>
387 <option value="<?=$k?>"><?=$v?></option>
388 <?php endforeach;?>
385 </select> 389 </select>
386 </span> 390 </span>
387 </div> 391 </div>
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!