bankadd.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. namespace WY\app\controller\mobile;
  3. use WY\app\libs\Controller;
  4. use WY\app\model\Bill;
  5. if (!defined('WY_ROOT')) {
  6. exit;
  7. }
  8. class bankadd extends CheckUser
  9. {
  10. public function index()
  11. {
  12. $data="";
  13. $this->put('bankadd.php', $data);
  14. }
  15. public function savecfo(){
  16. $bankname = $this->req->post('bankname');
  17. $provice = $this->req->post('provice');
  18. $city = $this->req->post('city');
  19. $branchname = $this->req->post('branchname');
  20. $accountname = $this->req->post('accountname');
  21. $cardno = $this->req->post('cardno');
  22. if ($bankname == '' || $provice == '' || $city == '' || $branchname == '' || $accountname == '' || $cardno == '') {
  23. echo json_encode(array('status' => 0));
  24. exit;
  25. }
  26. $data = array('userid' => $this->userData['id'], 'bankname' => $bankname, 'provice' => str_replace('省', '', $provice), 'city' => str_replace('市', '', $city), 'branchname' => $branchname, 'accountname' => $accountname, 'cardno' => $cardno, 'addtime' => time());
  27. if ($this->model()->from('cfo')->insertData($data)->insert()) {
  28. echo json_encode(array('status' => 1));
  29. exit;
  30. }
  31. echo json_encode(array('status' => 0));
  32. }
  33. }
  34. ?>