Пример #1
0
 public function borrowpaying()
 {
     $jsoncode = file_get_contents("php://input");
     $arr = array();
     $arr = json_decode($jsoncode, true);
     if (!$this->uid || $arr['uid'] != $this->uid) {
         ajaxmsg("请先登录", 0);
         exit;
     }
     if (!is_array($arr) || empty($arr) || empty($arr['uid'])) {
         ajaxmsg("查询错误!", 0);
     }
     if (is_array($arr) && isset($arr['id']) && isset($arr['type']) && isset($arr['num'])) {
         $type = $arr['type'];
         $id = intval($arr['id']);
         $num = intval($arr['num']);
     } else {
         $type = 2;
         $num = 5;
     }
     if ($type == 1) {
         $searchMap['id'] = array("gt", $id);
         //gt表示大于
         $order = "id ASC";
         //数据库里的主键和id比较
     } elseif ($type == 0) {
         $searchMap['id'] = array("lt", $id);
         //lt表示小于
         $order = "id DESC";
         //数据库里的主键和id比较
     } else {
         $order = "id DESC";
     }
     $searchMap['borrow_uid'] = $this->uid;
     $searchMap['borrow_status'] = array("in", "0,1,2,3,5,6,7");
     //$id = 30;
     $Bconfig = (require C("APP_ROOT") . "Conf/borrow_config.php");
     $bata['borrow_uid'] = $this->uid;
     $bata['borrow_status'] = 6;
     $bata['status'] = 7;
     $list = mcgetBorrowList($searchMap, $bata, $num, $order);
     foreach ($list['list'] as $key => $v) {
         $data[$key]['id'] = $v['id'];
         $data[$key]['repayment_type'] = $v['repayment_type'];
         $data[$key]['borrow_money'] = $v['borrow_money'];
         $data[$key]['repayment_money'] = $v['repayment_money'];
         $data[$key]['borrow_interest_rate'] = $v['borrow_interest_rate'];
         $data[$key]['borrow_duration'] = $v['borrow_duration'];
         $data[$key]['repayment_time'] = date("Y-m-d", $v['repayment_time']);
         $data[$key]['repayment_money'] = $v['repayment_money'];
     }
     $hh['list'] = $data;
     ajaxmsg($hh);
 }
Пример #2
0
 public function borrowpaying()
 {
     $jsoncode = file_get_contents("php://input");
     $arr = array();
     $arr = json_decode($jsoncode, true);
     if (!$this->uid || $arr['uid'] != $this->uid) {
         ajaxmsg("请先登陆", 0);
         exit;
     }
     $map['borrow_uid'] = $this->uid;
     $map['borrow_status'] = 6;
     $map['status'] = 7;
     $Bconfig = (require C("APP_ROOT") . "Conf/borrow_config.php");
     $func = (require c("APP_ROOT") . "Common/Apps/function.php");
     $list = mcgetBorrowList($map, 10);
     //var_dump($list);die;
     foreach ($list['list'] as $key => $v) {
         $data[$key]['id'] = $v['id'];
         $data[$key]['repayment_type'] = $v['repayment_type'];
         $data[$key]['borrow_money'] = $v['borrow_money'];
         $data[$key]['repayment_money'] = $v['repayment_money'];
         $data[$key]['borrow_interest_rate'] = $v['borrow_interest_rate'];
         $data[$key]['borrow_duration'] = $v['borrow_duration'];
         $data[$key]['repayment_time'] = date("Y-m-d", $v['repayment_time']);
         $data[$key]['repayment_money'] = $v['repayment_money'];
     }
     $hh['list'] = $data;
     ajaxmsg($hh);
 }