Пример #1
0
 public function member()
 {
     $utype = C('XMEMBER_TYPE');
     $area = get_Area_list();
     $uid = intval($_GET['id']);
     $vo = M('members m')->field("m.user_email,m.customer_name,m.user_phone,m.id,m.credits,m.is_ban,m.user_type,m.user_name,m.integral,m.active_integral,mi.*,mm.*,mb.*")->join("{$this->pre}member_info mi ON mi.uid=m.id")->join("{$this->pre}member_money mm ON mm.uid=m.id")->join("{$this->pre}member_banks mb ON mb.uid=m.id")->where("m.id={$uid}")->find();
     $vo['province'] = $area[$vo['province']];
     $vo['city'] = $area[$vo['city']];
     $vo['area'] = $area[$vo['area']];
     $vo['province_now'] = $area[$vo['province_now']];
     $vo['city_now'] = $area[$vo['city_now']];
     $vo['area_now'] = $area[$vo['area_now']];
     $vo['is_ban'] = $vo['is_ban'] == 0 ? "未冻结" : "<span style='color:red'>已冻结</span>";
     $vo['user_type'] = $utype[$vo['user_type']];
     //$vo['money_collect'] = M('investor_detail')->where(" investor_uid={$uid} AND status =7 ")->sum("capital+interest-interest_fee");
     //$vo['money_need'] = M('investor_detail')->where(" borrow_uid={$uid} AND status in(4,7) ")->sum("capital+interest");
     //$vo['money_all'] = $vo['account_money'] + $vo['money_freeze'] + $vo['money_collect'] - $vo['money_need'];
     $this->assign("capitalinfo", getMemberBorrowScan($uid));
     $this->assign("wc", getUserWC($uid));
     $this->assign("credit", getCredit($uid));
     $this->assign("vo", $vo);
     $this->assign("user", $vo['user_name']);
     //*******2013-11-23*************
     $minfo = getMinfo($uid, true);
     $this->assign("minfo", $minfo);
     $this->assign('benefit', get_personal_benefit($uid));
     //收益相关
     $this->assign('out', get_personal_out($uid));
     //支出相关
     $this->assign('pcount', get_personal_count($uid));
     $this->display();
 }
Пример #2
0
 public function summary()
 {
     $pre = C('DB_PREFIX');
     $this->assign("mx", getMemberBorrowScan($this->uid));
     $data['html'] = $this->fetch();
     exit(json_encode($data));
 }
Пример #3
0
 public function summary()
 {
     $uid = $this->uid;
     $pre = C('DB_PREFIX');
     $this->assign("dc", M('investor_detail')->where("investor_uid = {$this->uid}")->sum('substitute_money'));
     $this->assign("mx", getMemberBorrowScan($this->uid));
     $data['html'] = $this->fetch();
     exit(json_encode($data));
 }
Пример #4
0
 /**
 +----------------------------------------------------------
 * 默认操作
 +----------------------------------------------------------
 */
 public function member()
 {
     $utype = C('XMEMBER_TYPE');
     $area = get_Area_list();
     $uid = intval($_GET['id']);
     $vo = M('members m')->field("m.user_email,m.customer_name,m.user_phone,m.id,m.credits,m.is_ban,m.user_type,m.user_name,mi.*,mm.*,mb.*,mci.address c_address, mci.tel c_tel")->join("left join {$this->pre}member_info mi ON mi.uid=m.id")->join("left join {$this->pre}member_money mm ON mm.uid=m.id")->join("left join {$this->pre}member_banks mb ON mb.uid=m.id")->join("left join {$this->pre}member_contact_info mci ON mci.uid=m.id")->where("m.id={$uid}")->find();
     $vo['province'] = $area[$vo['province']];
     $vo['city'] = $area[$vo['city']];
     $vo['area'] = $area[$vo['area']];
     $vo['province_now'] = $area[$vo['province_now']];
     $vo['city_now'] = $area[$vo['city_now']];
     $vo['area_now'] = $area[$vo['area_now']];
     $vo['is_ban'] = $vo['is_ban'] == 0 ? "未冻结" : "<span style='color:red'>已冻结</span>";
     $vo['user_type'] = $utype[$vo['user_type']];
     $vo['money_all'] = $vo['account_money'] + $vo['money_freeze'] + $vo['money_collect'];
     $this->assign("capitalinfo", getMemberBorrowScan($uid));
     $this->assign("wc", getUserWC($uid));
     $this->assign("vo", $vo);
     $this->assign("user", $vo['user_name']);
     $this->display();
 }
Пример #5
0
 public function jiekuan()
 {
     $pre = C('DB_PREFIX');
     $jsoncode = file_get_contents("php://input");
     //		alogsm("jiekuan",0,1,session("u_id").$jsoncode);
     $arr = array();
     $arr = json_decode($jsoncode, true);
     //		if (!is_array($arr)||empty($arr)) {
     //		   ajaxmsg("密码1!",0);
     //		}
     //		if (intval($arr['uid'])!=$this->uid){
     //			ajaxmsg($arr['uid'],0);
     //		}
     $mx = getMemberBorrowScan($this->uid);
     $list['fbjr'] = $mx['borrow']['2']['money'] != null ? $mx['borrow']['2']['money'] : "0.00";
     $list['chjr'] = $mx['borrow']['6']['money'] != null ? $mx['borrow']['6']['money'] : "0.00";
     $list['hqjr'] = $mx['borrow']['7']['money'] != null ? $mx['borrow']['7']['money'] : "0.00";
     $list['expiredMoney'] = $mx['tj']['expiredMoney'];
     $list['jkze'] = $mx['tj']['jkze'];
     echo ajaxmsg($list);
     //$this->assign("mx",getMemberBorrowScan($this->uid));
     //$data['html'] = $this->display();
 }
Пример #6
0
 public function save()
 {
     if (!$this->uid) {
         $this->error("请先登陆", __APP__ . "/member/common/login");
     }
     $pre = C('DB_PREFIX');
     //相关的判断参数
     $rate_lixt = explode("|", $this->glo['rate_lixi']);
     $borrow_duration = explode("|", $this->glo['borrow_duration']);
     $borrow_duration_day = explode("|", $this->glo['borrow_duration_day']);
     $fee_borrow_manage = explode("|", $this->glo['fee_borrow_manage']);
     $vminfo = M('members m')->join("{$pre}member_info mf ON m.id=mf.uid")->field("m.user_leve,m.time_limit,mf.province_now,mf.city_now,mf.area_now")->where("m.id={$this->uid}")->find();
     //相关的判断参数
     $borrow['borrow_type'] = intval(cookie(text($_POST['vkey'])));
     if ($borrow['borrow_type'] == 50) {
         $this->error("校验数据有误,请重新发布");
     }
     $borrow['borrow_money'] = intval($_POST['borrow_money']);
     $_minfo = getMinfo($this->uid, true);
     $_capitalinfo = getMemberBorrowScan($this->uid);
     switch ($borrow['borrow_type']) {
         case 1:
             //普通标
             if ($_minfo['credit_cuse'] < $borrow['borrow_money']) {
                 $this->error("您的可用信用额度为{$_minfo['credit_cuse']}元,小于您准备借款的金额,不能发标");
             }
             break;
         case 2:
             //担保标
             if ($_minfo['borrow_vouch_cuse'] < $borrow['borrow_money']) {
                 $this->error("您的可用信用担保借款额度为{$_minfo['borrow_vouch_cuse']}元,小于您准备借款的金额,不能发标");
             }
             break;
         case 3:
             //秒还标
             break;
         case 4:
             //净值标
             $_netMoney = getFloatValue($minfo['money_collect'], 2);
             //getNet($_minfo,$_capitalinfo);
             if ($_netMoney < $borrow['borrow_money']) {
                 $this->error("您的净资产为{$_netMoney}元,小于您准备借款的金额,不能发标");
             }
             break;
         case 5:
             //抵押标
             //$borrow_type=5;
             break;
     }
     if ($borrow['borrow_type'] == 2) {
         //担保标
         $borrow['reward_vouch_rate'] = floatval($_POST['vouch_rate']);
         $borrow['reward_vouch_money'] = getFloatValue($borrow['borrow_money'] * $borrow['reward_vouch_rate'] / 100, 2);
         $borrow['vouch_member'] = text($_POST['vouch_member']);
     }
     $borrow['borrow_uid'] = $this->uid;
     $borrow['borrow_name'] = text($_POST['borrow_name']);
     $borrow['borrow_duration'] = $borrow['borrow_type'] == 3 ? 1 : intval($_POST['borrow_duration']);
     //秒标固定为一月
     $borrow['borrow_interest_rate'] = floatval($_POST['borrow_interest_rate']);
     if (strtolower($_POST['is_day']) == 'yes') {
         $borrow['repayment_type'] = 1;
     } elseif ($borrow['borrow_type'] == 3) {
         $borrow['repayment_type'] = 2;
     } else {
         $borrow['repayment_type'] = intval($_POST['repayment_type']);
     }
     if ($_POST['show_tbzj'] == 1) {
         $borrow['is_show_invest'] = 1;
     }
     //共几期(分几次还)
     $borrow['total'] = $borrow['repayment_type'] == 1 ? 1 : $borrow['borrow_duration'];
     //共几期(分几次还)
     $borrow['borrow_status'] = 0;
     $borrow['borrow_use'] = intval($_POST['borrow_use']);
     $borrow['add_time'] = time();
     $borrow['collect_day'] = intval($_POST['borrow_time']);
     $borrow['add_ip'] = get_client_ip();
     $borrow['borrow_info'] = text($_POST['borrow_info']);
     $borrow['reward_type'] = intval($_POST['reward_type']);
     $borrow['reward_num'] = floatval($_POST["reward_type_{$borrow['reward_type']}_value"]);
     $borrow['borrow_min'] = intval($_POST['borrow_min']);
     $borrow['borrow_max'] = intval($_POST['borrow_max']);
     $borrow['province'] = $vminfo['province_now'];
     $borrow['city'] = $vminfo['city_now'];
     $borrow['area'] = $vminfo['area_now'];
     if ($_POST['is_pass'] && intval($_POST['is_pass']) == 1) {
         $borrow['password'] = md5($_POST['password']);
     }
     //借款费和利息
     $borrow['borrow_interest'] = getBorrowInterest($borrow['repayment_type'], $borrow['borrow_money'], $borrow['borrow_duration'], $borrow['borrow_interest_rate']);
     if ($borrow['repayment_type'] == 1) {
         //按天还
         $fee_rate = is_numeric($fee_borrow_manage[0]) ? $fee_borrow_manage[0] / 100 : 0.001;
         $borrow['borrow_fee'] = getFloatValue($fee_rate * $borrow['borrow_money'] * $borrow['borrow_duration'], 2);
     } else {
         $fee_rate_1 = is_numeric($fee_borrow_manage[1]) ? $fee_borrow_manage[1] / 100 : 0.02;
         $fee_rate_2 = is_numeric($fee_borrow_manage[2]) ? $fee_borrow_manage[2] / 100 : 0.002;
         if ($borrow['borrow_duration'] > $fee_borrow_manage[3] && is_numeric($fee_borrow_manage[3])) {
             $borrow['borrow_fee'] = getFloatValue($fee_rate_1 * $borrow['borrow_money'], 2);
             $borrow['borrow_fee'] += getFloatValue($fee_rate_2 * $borrow['borrow_money'] * ($borrow['borrow_duration'] - $fee_borrow_manage[3]), 2);
         } else {
             $borrow['borrow_fee'] = getFloatValue($fee_rate_1 * $borrow['borrow_money'], 2);
         }
     }
     if ($borrow['borrow_type'] == 3) {
         //秒还标
         if ($borrow['reward_type'] > 0) {
             if ($borrow['reward_type'] == 1) {
                 $_reward_money = getFloatValue($borrow['borrow_money'] * $borrow['reward_num'] / 100, 2);
             } elseif ($borrow['reward_type'] == 2) {
                 $_reward_money = getFloatValue($borrow['reward_num'], 2);
             }
         }
         $_reward_money = floatval($_reward_money);
         if ($_minfo['account_money'] < $borrow['borrow_fee'] + $_reward_money) {
             $this->error("发布此标您最少需保证您的帐户余额大于等于" . ($borrow['borrow_fee'] + $_reward_money) . "元,以确保可以支付借款管理费和投标奖励费用");
         }
     }
     //投标上传图片资料(暂隐)
     foreach ($_POST['swfimglist'] as $key => $v) {
         if ($key > 10) {
             break;
         }
         $row[$key]['img'] = substr($v, 1);
         $row[$key]['info'] = $_POST['picinfo'][$key];
     }
     $borrow['updata'] = serialize($row);
     $borrow['is_tuijian'] = 1;
     $newid = M("borrow_info")->add($borrow);
     if ($newid) {
         $this->success("借款发布成功,网站会尽快初审", __APP__ . "/member/borrowin#fragment-1");
     } else {
         $this->error("发布失败,请先检查是否完成了个人详细资料然后重试");
     }
 }
Пример #7
0
 public function invest_people_info()
 {
     if (!$this->uid) {
         $this->qingxian();
     }
     $pre = C('DB_PREFIX');
     $id = intval($_GET['id']);
     $Bconfig = (require C("APP_ROOT") . "Conf/borrow_config.php");
     $borrowinfo = M("borrow_info bi")->field('bi.*,ac.title,ac.id as aid')->join('lzh_article ac on ac.id= bi.danbao')->where('bi.id=' . $id)->find();
     if (!is_array($borrowinfo) || $borrowinfo['borrow_status'] == 0 && $this->uid != $borrowinfo['borrow_uid']) {
         $this->error("数据有误");
     }
     $borrowinfo['biao'] = $borrowinfo['borrow_times'];
     $borrowinfo['need'] = $borrowinfo['borrow_money'] - $borrowinfo['has_borrow'];
     $borrowinfo['lefttime'] = $borrowinfo['collect_time'] - time();
     $borrowinfo['progress'] = getFloatValue($borrowinfo['has_borrow'] / $borrowinfo['borrow_money'] * 100, 2);
     $this->assign("vo", $borrowinfo);
     $memberinfo = M("members m")->field("m.id,m.user_phone,m.customer_name,m.customer_id,m.user_name,m.reg_time,m.credits,fi.*,mi.*,mm.*")->join("{$pre}member_financial_info fi ON fi.uid = m.id")->join("{$pre}member_info mi ON mi.uid = m.id")->join("{$pre}member_money mm ON mm.uid = m.id")->where("m.id={$borrowinfo['borrow_uid']}")->find();
     $areaList = getArea();
     if (!$memberinfo) {
         $memberinfo['credits'] = 0;
     }
     $memberinfo['location'] = $areaList[$memberinfo['province']] . $areaList[$memberinfo['city']];
     $memberinfo['location_now'] = $areaList[$memberinfo['province_now']] . $areaList[$memberinfo['city_now']];
     $memberinfo['zcze'] = $memberinfo['account_money'] + $memberinfo['back_money'] + $memberinfo['money_collect'] + $memberinfo['money_freeze'];
     //var_dump($memberinfo);die;
     $reg_time = date('Y-m-d H:i:s', $memberinfo['reg_time']);
     $this->assign("reg_time", $reg_time);
     $this->assign("minfo", $memberinfo);
     //$this->assign("capitalinfo", getMemberBorrowScan($borrowinfo['borrow_uid']));
     $this->assign("borrow_id", $id);
     $this->assign("capitalinfo", getMemberBorrowScan($borrowinfo['borrow_uid']));
     $this->display();
 }
Пример #8
0
function getMemberMoneySummary($uid)
{
    $pre = C('DB_PREFIX');
    $umoney = M('member_money')->field(true)->find($uid);
    $withdraw = M('member_withdraw')->field('withdraw_status,sum(withdraw_money) as withdraw_money,sum(withdraw_fee) as withdraw_fee')->where("uid={$uid}")->group("withdraw_status")->select();
    $withdraw_row = array();
    foreach ($withdraw as $wkey => $wv) {
        $withdraw_row[$wv['withdraw_status']] = $wv;
    }
    $withdraw0 = $withdraw_row[0];
    $withdraw1 = $withdraw_row[1];
    $withdraw2 = $withdraw_row[2];
    $payonline = M('member_payonline')->where("uid={$uid} AND status=1")->sum('money');
    $commission1 = M('borrow_investor')->where("investor_uid={$uid}")->sum('paid_fee');
    $commission2 = M('borrow_info')->where("borrow_uid={$uid} AND borrow_status in(3,4)")->sum('borrow_fee');
    $uplevefee = M('member_moneylog')->where("uid={$uid} AND type=2")->sum('affect_money');
    $czfee = M('member_payonline')->where("uid={$uid} AND status=1")->sum('fee');
    $toubiaojl = M('borrow_investor')->where("investor_uid={$uid}")->sum('reward_money');
    //投标奖励
    $tuiguangjl = M('member_moneylog')->where("uid={$uid} and type=13")->sum('affect_money');
    //推广奖励
    $xianxiajl = M('member_moneylog')->where("uid={$uid} and type=33")->sum('affect_money');
    //线下充值奖励
    $capitalinfo = getMemberBorrowScan($uid);
    $money['zye'] = $umoney['account_money'] + $umoney['money_collect'] + $umoney['money_freeze'];
    //帐户总额
    $money['kyxjje'] = $umoney['account_money'];
    //可用金额
    $money['djje'] = $umoney['money_freeze'];
    //冻结金额
    $money['jjje'] = 0;
    //奖金金额
    $money['dsbx'] = $umoney['money_collect'];
    //待收本息
    $money['dfbx'] = round($capitalinfo['tj']['dhze'] - $capitalinfo['tj']['payInterest']);
    //待付本息
    $money['dxrtb'] = $capitalinfo['tj']['dqrtb'];
    //待确认投标
    $money['dshtx'] = $withdraw0['withdraw_money'];
    //待审核提现
    $money['clztx'] = $withdraw1['withdraw_money'];
    //处理中提现
    $money['total_1'] = round($money['kyxjje'] + $money['jjje'] + $money['dsbx'] - $money['dfbx'] + $money['dxrtb'] + $money['dshtx'] + $money['clztx'], 2);
    $money['jzlx'] = $capitalinfo['tj']['earnInterest'];
    //净赚利息
    $money['jflx'] = $capitalinfo['tj']['payInterest'];
    //净付利息
    $money['ljjj'] = $umoney['reward_money'];
    //累计收到奖金
    $money['ljhyf'] = $uplevefee;
    //累计支付会员费
    $money['ljtxsxf'] = $withdraw2['withdraw_fee'];
    //累计提现手续费
    $money['ljczsxf'] = $czfee;
    //累计充值手续费
    $money['ljtbjl'] = $toubiaojl;
    //累计投标奖励
    $money['ljtgjl'] = $tuiguangjl;
    //累计推广奖励
    $money['xxjl'] = $xianxiajl;
    //线下充值奖励
    $money['total_2'] = $money['jzlx'] - $money['jflx'] + $money['ljjj'] - $money['ljhyf'] - $money['ljtxsxf'] - $money['ljczsxf'] + $money['ljtbjl'] + $money['ljtgjl'] + $money['xxjl'];
    $money['ljtzje'] = $capitalinfo['tj']['borrowOut'];
    //累计投资金额
    $money['ljjrje'] = $capitalinfo['tj']['borrowIn'];
    //累计借入金额
    $money['ljczje'] = $payonline;
    //累计充值金额
    $money['ljtxje'] = $withdraw2['withdraw_money'];
    //累计提现金额
    $money['ljzfyj'] = $commission1 + $commission2;
    //累计支付佣金
    //
    $money['dslxze'] = $capitalinfo['tj']['willgetInterest'];
    //待收利息总额
    $money['dflxze'] = $capitalinfo['tj']['willpayInterest'];
    //待付利息总额
    return $money;
}
Пример #9
0
 public function loan()
 {
     $this->assign("mx", getMemberBorrowScan($this->uid));
     $this->display();
 }
Пример #10
0
 public function tdetail()
 {
     if ($_GET['type'] == 'commentlist') {
         //评论
         $cmap['tid'] = intval($_GET['id']);
         $clist = getCommentList($cmap, 5);
         $this->assign("commentlist", $clist['list']);
         $this->assign("commentpagebar", $clist['page']);
         $this->assign("commentcount", $clist['count']);
         $data['html'] = $this->fetch('commentlist');
         exit(json_encode($data));
     }
     $pre = C('DB_PREFIX');
     $id = intval($_GET['id']);
     $Bconfig = (require C("APP_ROOT") . "Conf/borrow_config.php");
     //合同ID
     if ($this->uid) {
         $invs = M('borrow_investor')->field('id')->where("borrow_id={$id} AND (investor_uid={$this->uid})")->find();
         if ($invs['id'] > 0) {
             $invsx = $invs['id'];
         } elseif (!is_array($invs)) {
             $invsx = 'no';
         }
     } else {
         $invsx = 'login';
     }
     $this->assign("invid", $invsx);
     //合同ID
     //borrowinfo
     //$borrowinfo = M("borrow_info")->field(true)->find($id);
     $borrowinfo = M("borrow_info bi")->field('bi.*,ac.title,ac.id as aid')->join('lzh_article ac on ac.id= bi.danbao')->where('bi.id=' . $id)->find();
     if (!is_array($borrowinfo) || $borrowinfo['borrow_status'] == 0 && $this->uid != $borrowinfo['borrow_uid']) {
         $this->error("数据有误");
     }
     $borrowinfo['biao'] = $borrowinfo['borrow_times'];
     $borrowinfo['need'] = $borrowinfo['borrow_money'] - $borrowinfo['has_borrow'];
     $borrowinfo['lefttime'] = $borrowinfo['collect_time'] - time();
     $borrowinfo['progress'] = getFloatValue($borrowinfo['has_borrow'] / $borrowinfo['borrow_money'] * 100, 2);
     $this->assign("vo", $borrowinfo);
     $memberinfo = M("members m")->field("m.id,m.customer_name,m.customer_id,m.user_name,m.reg_time,m.credits,fi.*,mi.*,mm.*")->join("{$pre}member_financial_info fi ON fi.uid = m.id")->join("{$pre}member_info mi ON mi.uid = m.id")->join("{$pre}member_money mm ON mm.uid = m.id")->where("m.id={$borrowinfo['borrow_uid']}")->find();
     $areaList = getArea();
     $memberinfo['location'] = $areaList[$memberinfo['province']] . $areaList[$memberinfo['city']];
     $memberinfo['location_now'] = $areaList[$memberinfo['province_now']] . $areaList[$memberinfo['city_now']];
     $memberinfo['zcze'] = $memberinfo['account_money'] + $memberinfo['back_money'] + $memberinfo['money_collect'] + $memberinfo['money_freeze'];
     $this->assign("minfo", $memberinfo);
     //data_list
     $data_list = M("member_data_info")->field('type,add_time,count(status) as num,sum(deal_credits) as credits')->where("uid={$borrowinfo['borrow_uid']} AND status=1")->group('type')->select();
     $this->assign("data_list", $data_list);
     //data_list
     // 投资记录
     $this->investRecord($id);
     $this->assign('borrow_id', $id);
     //近期还款的投标
     //$time1 = microtime(true)*1000;
     $history = getDurationCount($borrowinfo['borrow_uid']);
     $this->assign("history", $history);
     //$time2 = microtime(true)*1000;
     //echo $time2-$time1;
     //investinfo
     $fieldx = "bi.investor_capital,bi.add_time,m.user_name,bi.is_auto";
     $investinfo = M("borrow_investor bi")->field($fieldx)->join("{$pre}members m ON bi.investor_uid = m.id")->limit(10)->where("bi.borrow_id={$id}")->order("bi.id DESC")->select();
     $this->assign("investinfo", $investinfo);
     //investinfo
     //帐户资金情况
     $this->assign("investInfo", getMinfo($this->uid, true));
     $this->assign("mainfo", getMinfo($borrowinfo['borrow_uid'], true));
     $this->assign("capitalinfo", getMemberBorrowScan($borrowinfo['borrow_uid']));
     //帐户资金情况
     //展示资料
     $show_list = M("member_borrow_show")->where("uid={$borrowinfo['borrow_uid']}")->order('sort DESC')->select();
     $this->assign("show_list", $show_list);
     //展示资料
     //上传资料类型
     $upload_type = FilterUploadType(FS("Webconfig/integration"));
     $this->assign("upload_type", $upload_type);
     // 上传资料所有类型
     //评论
     $cmap['tid'] = $id;
     $clist = getCommentList($cmap, 5);
     $this->assign("Bconfig", $Bconfig);
     $this->assign("gloconf", $this->gloconf);
     $this->assign("commentlist", $clist['list']);
     $this->assign("commentpagebar", $clist['page']);
     $this->assign("commentcount", $clist['count']);
     $this->display();
 }
Пример #11
0
 public function save()
 {
     $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);
     }
     $pre = C('DB_PREFIX');
     $id = intval($arr['id']);
     //$id = 30;
     $Bconfig = (require C("APP_ROOT") . "Conf/borrow_config.php");
     //相关的判断参数
     $rate_lixt = explode("|", $this->glo['rate_lixi']);
     $borrow_duration = explode("|", $this->glo['borrow_duration']);
     $borrow_duration_day = explode("|", $this->glo['borrow_duration_day']);
     $fee_borrow_manage = explode("|", $this->glo['fee_borrow_manage']);
     $vminfo = M('members m')->join("{$pre}member_info mf ON m.id=mf.uid")->field("m.user_leve,m.time_limit,mf.province_now,mf.city_now,mf.area_now,m.is_vip,m.is_borrow")->where("m.id={$this->uid}")->find();
     //var_dump($vminfo);die;
     if ($vminfo['is_vip'] == 0) {
         $_xoc = M('borrow_info')->where("borrow_uid={$this->uid} AND borrow_status in(0,2,4)")->count('id');
         if ($_xoc > 0) {
             ajaxmsg("您有一个借款中的标,请等待审核", 0);
         }
         if (!($vminfo['user_leve'] > 0 && $vminfo['time_limit'] > time())) {
             ajaxmsg("请先通过VIP审核再发标", 0);
         }
         if ($vminfo['is_borrow'] == 0) {
             ajaxmsg("您目前不允许发布借款,如需帮助,请与客服人员联系!", 0);
             //$this->assign("waitSecond",3);
         }
         $vo = getMemberDetail($this->uid);
         if ($vo['province'] == 0 && $vo['province_now '] == 0 && $vo['province_now '] == 0 && $vo['city'] == 0 && $vo['city_now'] == 0) {
             ajaxmsg("请先填写个人详细资料后再发标", 0);
         }
     }
     $borrow['borrow_type'] = $arr['vkey'];
     //intval(cookie(text($_POST['vkey'])));
     //dump($borrow['borrow_type']);die;
     if ($borrow['borrow_type'] == 0) {
         ajaxmsg("校验数据有误,请重新发布", 0);
     }
     if (floatval($arr['borrow_interest_rate']) > $rate_lixt[1] || floatval($arr['borrow_interest_rate']) < $rate_lixt[0]) {
         ajaxmsg("提交的借款利率不在允许范围,请重试", 0);
     }
     $borrow['borrow_money'] = intval($arr['borrow_money']);
     $_minfo = getMinfo($this->uid, "m.pin_pass,mm.account_money,mm.back_money,mm.credit_cuse,mm.money_collect");
     $_capitalinfo = getMemberBorrowScan($this->uid);
     ///////////////////////////////////////////////////////
     //$vo = M('members m')->field('mm.account_money,mm.back_money,(mm.account_money+mm.back_money) all_money,m.user_leve,m.time_limit')->join("{$pre}member_money mm on mm.uid = //m.id")->where("m.id={$this->uid} AND m.pin_pass='******'")->find();
     $borrowNum = M('borrow_info')->field("borrow_type,count(id) as num,sum(borrow_money) as money,sum(repayment_money) as repayment_money")->where("borrow_uid = {$this->uid} AND borrow_status=6 ")->group("borrow_type")->select();
     $borrowDe = array();
     foreach ($borrowNum as $k => $v) {
         $borrowDe[$v['borrow_type']] = $v['money'] - $v['repayment_money'];
     }
     ///////////////////////////////////////////////////
     switch ($borrow['borrow_type']) {
         case 1:
             //普通标
             if ($_minfo['credit_cuse'] < $borrow['borrow_money']) {
                 ajaxmsg("您的可用信用额度为{$_minfo['credit_cuse']}元,小于您准备借款的金额,不能发标", 0);
             }
             break;
         case 2:
             //新担保标
             break;
         case 4:
             //净值标
             $_netMoney = getFloatValue(0.9 * $_minfo['money_collect'] - $borrowDe[4], 2);
             if ($_netMoney < $borrow['borrow_money']) {
                 ajaxmsg("您的净值额度{$_netMoney}元,小于您准备借款的金额,不能发标", 0);
             }
             break;
         case 5:
             //抵押标
             //$borrow_type=5;
             break;
     }
     $borrow['borrow_uid'] = $this->uid;
     $borrow['borrow_name'] = text($arr['borrow_name']);
     $borrow['borrow_duration'] = $borrow['borrow_type'] == 3 ? 1 : intval($arr['borrow_duration']);
     //秒标固定为一月
     $borrow['borrow_interest_rate'] = floatval($arr['borrow_interest_rate']);
     if (strtolower($arr['is_day']) == 'yes') {
         $borrow['repayment_type'] = 1;
     } elseif ($borrow['borrow_type'] == 3) {
         $borrow['repayment_type'] = 2;
     } else {
         $borrow['repayment_type'] = intval($arr['repayment_type']);
     }
     if ($borrow['repayment_type'] == '1' || $borrow['repayment_type'] == '5') {
         $borrow['total'] = 1;
     } else {
         $borrow['total'] = $borrow['borrow_duration'];
         //分几期还款
     }
     $borrow['borrow_status'] = 0;
     $borrow['borrow_use'] = intval($arr['borrow_use']);
     $borrow['add_time'] = time();
     $borrow['collect_day'] = intval($arr['borrow_time']);
     $borrow['add_ip'] = get_client_ip();
     $borrow['borrow_info'] = text($arr['borrow_info']);
     $borrow['reward_type'] = intval($arr['reward_type']);
     $borrow['reward_num'] = floatval($arr["reward_type_{$borrow['reward_type']}_value"]);
     $borrow['borrow_min'] = intval($arr['borrow_min']);
     $borrow['borrow_max'] = intval($arr['borrow_max']);
     //$borrow['province'] = $vminfo['province_now'];
     //$borrow['city'] = $vminfo['city_now'];
     //$borrow['area'] = $vminfo['area_now'];
     if ($arr['is_pass'] && intval($arr['is_pass']) == 1) {
         $borrow['password'] = md5($arr['password']);
     }
     $borrow['money_collect'] = floatval($arr['moneycollect']);
     //代收金额限制设置
     //借款费和利息
     $borrow['borrow_interest'] = getBorrowInterest($borrow['repayment_type'], $borrow['borrow_money'], $borrow['borrow_duration'], $borrow['borrow_interest_rate']);
     $borrow['borrow_fee'] = 0.0;
     if ($borrow['borrow_type'] == 3) {
         //秒还标
         if ($borrow['reward_type'] > 0) {
             $_reward_money = getFloatValue($borrow['borrow_money'] * $borrow['reward_num'] / 100, 2);
         }
         $_reward_money = floatval($_reward_money);
         if ($_minfo['account_money'] + $_minfo['back_money'] < $borrow['borrow_fee'] + $_reward_money) {
             ajaxmsg("发布此标您最少需保证您的帐户余额大于等于" . ($borrow['borrow_fee'] + $_reward_money) . "元,以确保可以支付借款管理费和投标奖励费用", 0);
         }
     }
     //投标上传图片资料(暂隐)
     foreach ($arr['swfimglist'] as $key => $v) {
         if ($key > 10) {
             break;
         }
         $row[$key]['img'] = substr($v, 1);
         $row[$key]['info'] = $arr['picinfo'][$key];
     }
     $borrow['updata'] = serialize($row);
     $newid = M("borrow_info")->add($borrow);
     $suo = array();
     $suo['id'] = $newid;
     $suo['suo'] = 0;
     $suoid = M("borrow_info_lock")->add($suo);
     if ($newid) {
         ajaxmsg("借款发布成功,网站会尽快初审", 1);
     } else {
         ajaxmsg("发布失败,请先检查是否完成了个人详细资料然后重试", 0);
     }
 }
Пример #12
0
 public function save()
 {
     if (!$this->uid) {
         $this->error("请先登陆", __APP__ . "/member/common/login");
     }
     $pre = C('DB_PREFIX');
     //相关的判断参数
     $rate_lixt = explode("|", $this->glo['rate_lixi']);
     $borrow_duration = explode("|", $this->glo['borrow_duration']);
     $borrow_duration_day = explode("|", $this->glo['borrow_duration_day']);
     $fee_borrow_manage = explode("|", $this->glo['fee_borrow_manage']);
     $vminfo = M('members m')->join("{$pre}member_info mf ON m.id=mf.uid")->field("m.user_leve,m.time_limit,mf.province_now,mf.city_now,mf.area_now")->where("m.id={$this->uid}")->find();
     //相关的判断参数
     $borrow['borrow_type'] = intval(cookie(text($_POST['vkey'])));
     if ($borrow['borrow_type'] == 0) {
         $this->error("校验数据有误,请重新发布");
     }
     if (floatval($_POST['borrow_interest_rate']) > $rate_lixt[1] || floatval($_POST['borrow_interest_rate']) < $rate_lixt[0]) {
         $this->error("提交的借款利率超出允许范围,请重试", 0);
     }
     //if($_POST['borrow_btype']==0) $this->error("请选择标的类型");
     $borrow['borrow_money'] = intval($_POST['borrow_money']);
     $_minfo = getMinfo($this->uid, "m.pin_pass,mm.account_money,mm.back_money,mm.credit_cuse,mm.money_collect");
     $_capitalinfo = getMemberBorrowScan($this->uid);
     ///////////////////////////////////////////////////////
     $borrowNum = M('borrow_info')->field("borrow_type,count(id) as num,sum(borrow_money) as money,sum(repayment_money) as repayment_money")->where("borrow_uid = {$this->uid} AND borrow_status=6 ")->group("borrow_type")->select();
     $borrowDe = array();
     foreach ($borrowNum as $k => $v) {
         $borrowDe[$v['borrow_type']] = $v['money'] - $v['repayment_money'];
     }
     ///////////////////////////////////////////////////
     switch ($borrow['borrow_type']) {
         case 1:
             //普通标
             if ($_minfo['credit_cuse'] < $borrow['borrow_money']) {
                 $this->error("您的可用信用额度为{$_minfo['credit_cuse']}元,小于您准备借款的金额,不能发标");
             }
             break;
         case 2:
             //新担保标
         //新担保标
         case 3:
             //秒还标
             break;
         case 4:
             //净值标
             $_netMoney = getFloatValue(0.9 * $_minfo['money_collect'] - $borrowDe[4], 2);
             if ($_netMoney < $borrow['borrow_money']) {
                 $this->error("您的净值额度{$_netMoney}元,小于您准备借款的金额,不能发标");
             }
             break;
         case 5:
             //抵押标
             //$borrow_type=5;
             break;
     }
     $borrow['borrow_uid'] = $this->uid;
     $borrow['borrow_name'] = text($_POST['borrow_name']);
     $borrow['borrow_duration'] = $borrow['borrow_type'] == 3 ? 1 : intval($_POST['borrow_duration']);
     //秒标固定为一月
     $borrow['borrow_interest_rate'] = floatval($_POST['borrow_interest_rate']);
     if (strtolower($_POST['is_day']) == 'yes') {
         $borrow['repayment_type'] = 1;
     } elseif ($borrow['borrow_type'] == 3) {
         $borrow['repayment_type'] = 2;
     } else {
         $borrow['repayment_type'] = intval($_POST['repayment_type']);
     }
     if ($borrow['repayment_type'] == '1' || $borrow['repayment_type'] == '5') {
         $borrow['total'] = 1;
     } else {
         $borrow['total'] = $borrow['borrow_duration'];
         //分几期还款
     }
     $borrow['borrow_status'] = 0;
     $borrow['borrow_use'] = intval($_POST['borrow_use']);
     $borrow['add_time'] = time();
     $borrow['collect_day'] = intval($_POST['borrow_time']);
     $borrow['add_ip'] = get_client_ip();
     $borrow['borrow_info'] = text($_POST['borrow_info']);
     $borrow['reward_type'] = intval($_POST['reward_type']);
     $borrow['reward_num'] = floatval($_POST["reward_type_{$borrow['reward_type']}_value"]);
     $borrow['borrow_min'] = intval($_POST['borrow_min']);
     $borrow['borrow_max'] = intval($_POST['borrow_max']);
     $borrow['borrow_btype'] = intval($_POST['borrow_btype']);
     $borrow['ifdianzibiao'] = $_POST['ifdianzibiao'];
     $borrow['is_tuijian'] = $_POST['is_tuijian'];
     /*$borrow['province'] = $vminfo['province_now'];
     		$borrow['city'] = $vminfo['city_now'];
     		$borrow['area'] = $vminfo['area_now'];*/
     if ($_POST['is_pass'] && intval($_POST['is_pass']) == 1) {
         $borrow['password'] = md5($_POST['password']);
     }
     $borrow['money_collect'] = floatval($_POST['moneycollect']);
     //代收金额限制设置
     //借款费和利息
     $borrow['borrow_interest'] = getBorrowInterest($borrow['repayment_type'], $borrow['borrow_money'], $borrow['borrow_duration'], $borrow['borrow_interest_rate']);
     if ($borrow['repayment_type'] == 1) {
         //按天还
         $fee_rate = is_numeric($fee_borrow_manage[0]) ? $fee_borrow_manage[0] / 100 : 0.001;
         $borrow['borrow_fee'] = getFloatValue($fee_rate * $borrow['borrow_money'] * $borrow['borrow_duration'], 2);
     } else {
         $fee_rate_1 = is_numeric($fee_borrow_manage[1]) ? $fee_borrow_manage[1] / 100 : 0.02;
         $fee_rate_2 = is_numeric($fee_borrow_manage[2]) ? $fee_borrow_manage[2] / 100 : 0.002;
         if ($borrow['borrow_duration'] > $fee_borrow_manage[3] && is_numeric($fee_borrow_manage[3])) {
             $borrow['borrow_fee'] = getFloatValue($fee_rate_1 * $borrow['borrow_money'], 2);
             $borrow['borrow_fee'] += getFloatValue($fee_rate_2 * $borrow['borrow_money'] * ($borrow['borrow_duration'] - $fee_borrow_manage[3]), 2);
         } else {
             $borrow['borrow_fee'] = getFloatValue($fee_rate_1 * $borrow['borrow_money'], 2);
         }
     }
     if ($borrow['borrow_type'] == 3) {
         //秒还标
         if ($borrow['reward_type'] > 0) {
             $_reward_money = getFloatValue($borrow['borrow_money'] * $borrow['reward_num'] / 100, 2);
         }
         $_reward_money = floatval($_reward_money);
         if ($_minfo['account_money'] + $_minfo['back_money'] < $borrow['borrow_fee'] + $_reward_money) {
             $this->error("发布此标您最少需保证您的帐户余额大于等于" . ($borrow['borrow_fee'] + $_reward_money) . "元,以确保可以支付借款管理费和投标奖励费用");
         }
     }
     //投标上传图片资料(暂隐)
     foreach ($_POST['swfimglist'] as $key => $v) {
         if ($key > 10) {
             break;
         }
         $row[$key]['img'] = substr($v, 1);
         $row[$key]['info'] = $_POST['picinfo'][$key];
     }
     $borrow['updata'] = serialize($row);
     $newid = M("borrow_info")->add($borrow);
     //var_dump($borrow);exit;
     $suo = array();
     $suo['id'] = $newid;
     $suo['suo'] = 0;
     $suoid = M("borrow_info_lock")->add($suo);
     if ($newid) {
         $this->success("借款发布成功,网站会尽快初审", __APP__ . "/member/borrowin#fragment-2");
     } else {
         $this->error("发布失败,请先检查是否完成了个人详细资料然后重试");
     }
 }
Пример #13
0
 public function save()
 {
     //if(!$this->uid) $this->error("请先登录",__APP__."/member/common/login");
     //if(empty($_FILES['topic']['name'])){
     //	$this->error('请上传标题图片');
     //}
     $borrow = array();
     //$this->savePathNew = C('HOME_UPLOAD_DIR').'Product/';
     //$this->thumbMaxWidth = C('PRODUCT_UPLOAD_W');
     //$this->thumbMaxHeight = C('PRODUCT_UPLOAD_H');
     //$this->saveRule = date("YmdHis",time()).rand(0,1000);
     //$info = $this->CUpload();
     //$borrow['topic'] = $info[0]['savepath'].$info[0]['savename'];
     if ($_POST['borrow_uid'] == '') {
         $this->error('选择借款人不能为空!');
     }
     if ($_POST['borrow_type'] == '') {
         $this->error('借款标类型不能为空!');
     }
     if ($_POST['reward_type'] && ($_POST['reward_type_1_value'] > 6 || $_POST['reward_type_1_value'] < 0)) {
         $this->error("投标奖励超出范围!");
     }
     if ($this->_post('stock_type') == '') {
         $this->error("选择配资类型不能为空!");
     }
     $capital_name = htmlspecialchars($this->_post('capital_name'));
     $capital_card = htmlspecialchars($this->_post('capital_card'));
     $pre = C('DB_PREFIX');
     //相关的判断参数
     $rate_lixt = explode("|", $this->glo['rate_lixi']);
     $borrow_duration = explode("|", $this->glo['borrow_duration']);
     $borrow_duration_day = explode("|", $this->glo['borrow_duration_day']);
     $fee_borrow_manage = explode("|", $this->glo['fee_borrow_manage']);
     $vminfo = M('members m')->join("{$pre}member_info mf ON m.id=mf.uid")->field("m.user_leve,m.time_limit,mf.province_now,mf.city_now,mf.area_now")->where("m.id={$this->uid}")->find();
     //相关的判断参数
     $borrow['borrow_type'] = $this->_post('borrow_type');
     if ($borrow['borrow_type'] == 0) {
         $this->error("校验数据有误,请重新发布");
     }
     if (floatval($_POST['borrow_interest_rate']) > $rate_lixt[1] || floatval($_POST['borrow_interest_rate']) < $rate_lixt[0]) {
         $this->error("提交的借款利率超出允许范围,请重试", 0);
     }
     $borrow['borrow_money'] = intval($_POST['borrow_money']);
     $_minfo = getMinfo($this->uid, "m.pin_pass,mm.account_money,mm.back_money,mm.credit_cuse,mm.money_collect");
     $_capitalinfo = getMemberBorrowScan($this->uid);
     ///////////////////////////////////////////////////////
     $borrowNum = M('borrow_info')->field("borrow_type,count(id) as num,sum(borrow_money) as money,sum(repayment_money) as repayment_money")->where("borrow_uid = {$this->uid} AND borrow_status=6 ")->group("borrow_type")->select();
     $borrowDe = array();
     foreach ($borrowNum as $k => $v) {
         $borrowDe[$v['borrow_type']] = $v['money'] - $v['repayment_money'];
     }
     ///////////////////////////////////////////////////
     switch ($borrow['borrow_type']) {
         case 1:
             //普通标
             //if($_minfo['credit_cuse']<$borrow['borrow_money']) $this->error("您的可用信用额度为{$_minfo['credit_cuse']}元,小于您准备借款的金额,不能发标");
             break;
         case 2:
             //新担保标
         //新担保标
         case 3:
             //秒还标
             break;
         case 4:
             //净值标
             //$_netMoney = getFloatValue(0.9*$_minfo['money_collect']-$borrowDe[4],2);
             //if($_netMoney<$borrow['borrow_money']) $this->error("您的净值额度{$_netMoney}元,小于您准备借款的金额,不能发标");
             break;
         case 5:
             //抵押标
             //$borrow_type=5;
             break;
     }
     $borrow['borrow_uid'] = $this->_post("borrow_uid");
     $borrow['borrow_name'] = text($_POST['borrow_name']);
     $borrow['borrow_duration'] = $borrow['borrow_type'] == 3 ? 1 : intval($_POST['borrow_duration']);
     //秒标固定为一月
     $borrow['borrow_interest_rate'] = floatval($_POST['borrow_interest_rate']);
     if (strtolower($_POST['is_day']) == 'yes') {
         $borrow['repayment_type'] = 1;
     } elseif ($borrow['borrow_type'] == 3) {
         $borrow['repayment_type'] = 2;
     } else {
         $borrow['repayment_type'] = intval($_POST['repayment_type']);
     }
     if ($borrow['repayment_type'] == '1' || $borrow['repayment_type'] == '5') {
         $borrow['total'] = 1;
     } else {
         $borrow['total'] = $borrow['borrow_duration'];
         //分几期还款
     }
     $borrow['capital_name'] = $capital_name;
     $borrow['capital_card'] = $capital_card;
     $borrow['borrow_status'] = 0;
     $borrow['borrow_use'] = intval($_POST['borrow_use']);
     $borrow['add_time'] = time();
     $borrow['collect_day'] = intval($_POST['borrow_time']);
     $borrow['add_ip'] = get_client_ip();
     $borrow['borrow_info'] = text($_POST['borrow_info']);
     $borrow['reward_type'] = intval($_POST['reward_type']);
     $borrow['reward_num'] = floatval($_POST["reward_type_{$borrow['reward_type']}_value"]);
     $borrow['borrow_min'] = intval($_POST['borrow_min']);
     $borrow['borrow_max'] = intval($_POST['borrow_max']);
     $prow = array();
     foreach ($_POST['swfimglist'] as $key => $v) {
         $prow[$key]['img'] = substr($v, 1);
         $prow[$key]['info'] = $_POST['picinfo'][$key];
     }
     $borrow['updata'] = false === empty($prow) ? serialize($prow) : '';
     /*$borrow['province'] = $vminfo['province_now'];
     		$borrow['city'] = $vminfo['city_now'];
     		$borrow['area'] = $vminfo['area_now'];*/
     if ($_POST['is_pass'] && intval($_POST['is_pass']) == 1) {
         $borrow['password'] = md5($_POST['password']);
     }
     $borrow['money_collect'] = floatval($_POST['moneycollect']);
     //代收金额限制设置
     //借款费和利息
     $borrow['borrow_interest'] = getBorrowInterest($borrow['repayment_type'], $borrow['borrow_money'], $borrow['borrow_duration'], $borrow['borrow_interest_rate']);
     if ($borrow['repayment_type'] == 1) {
         //按天还
         $fee_rate = is_numeric($fee_borrow_manage[0]) ? $fee_borrow_manage[0] / 100 : 0.001;
         $borrow['borrow_fee'] = getFloatValue($fee_rate * $borrow['borrow_money'] * $borrow['borrow_duration'], 2);
     } else {
         $fee_rate_1 = is_numeric($fee_borrow_manage[1]) ? $fee_borrow_manage[1] / 100 : 0.02;
         $fee_rate_2 = is_numeric($fee_borrow_manage[2]) ? $fee_borrow_manage[2] / 100 : 0.002;
         if ($borrow['borrow_duration'] > $fee_borrow_manage[3] && is_numeric($fee_borrow_manage[3])) {
             $borrow['borrow_fee'] = getFloatValue($fee_rate_1 * $borrow['borrow_money'], 2);
             $borrow['borrow_fee'] += getFloatValue($fee_rate_2 * $borrow['borrow_money'] * ($borrow['borrow_duration'] - $fee_borrow_manage[3]), 2);
         } else {
             $borrow['borrow_fee'] = getFloatValue($fee_rate_1 * $borrow['borrow_money'], 2);
         }
     }
     if ($borrow['borrow_type'] == 3) {
         //秒还标
         if ($borrow['reward_type'] > 0) {
             $_reward_money = getFloatValue($borrow['borrow_money'] * $borrow['reward_num'] / 100, 2);
         }
         $_reward_money = floatval($_reward_money);
         if ($_minfo['account_money'] + $_minfo['back_money'] < $borrow['borrow_fee'] + $_reward_money) {
             $this->error("发布此标您最少需保证您的帐户余额大于等于" . ($borrow['borrow_fee'] + $_reward_money) . "元,以确保可以支付借款管理费和投标奖励费用");
         }
     }
     if ($borrow['borrow_type'] == 2) {
         $borrow['danbao'] = $_POST['danbao'];
         $borrow['huilv'] = M('article')->where("id=" . $_POST['danbao'])->getField('art_keyword');
     }
     //投标上传图片资料(暂隐)
     foreach ($_POST['swfimglist'] as $key => $v) {
         if ($key > 10) {
             break;
         }
         $row[$key]['img'] = substr($v, 1);
         $row[$key]['info'] = $_POST['picinfo'][$key];
     }
     $borrow['updata'] = serialize($row);
     $borrow['stock_the'] = $this->_post("stock_the");
     $borrow['stock_bond_money'] = $this->_post("stock_bond_money");
     $borrow['stock_type'] = $this->_post('stock_type');
     $newid = M("borrow_info")->add($borrow);
     $suo = array();
     $suo['id'] = $newid;
     $suo['suo'] = 0;
     $suoid = M("borrow_info_lock")->add($suo);
     if ($newid) {
         $this->success("借款发布成功,网站会尽快初审");
     } else {
         $this->error("发布失败,请先检查是否完成了个人详细资料然后重试");
     }
 }
Пример #14
0
 public function detail()
 {
     $vminfo = M('members')->field("user_leve,time_limit")->find($this->uid);
     if (!($vminfo['user_leve'] > 0 && $vminfo['time_limit'] > time())) {
         $this->error("请先通过VIP审核再投资", __APP__ . "/member/vip/invest");
     }
     if ($_GET['type'] == 'commentlist') {
         //评论
         $cmap['tid'] = intval($_GET['id']);
         $clist = getCommentList($cmap, 5);
         $this->assign("commentlist", $clist['list']);
         $this->assign("commentpagebar", $clist['page']);
         $this->assign("commentcount", $clist['count']);
         $data['html'] = $this->fetch('commentlist');
         exit(json_encode($data));
     }
     $pre = C('DB_PREFIX');
     $id = intval($_GET['id']);
     $Bconfig = (require C("APP_ROOT") . "Conf/borrow_config.php");
     //合同ID
     if ($this->uid) {
         $invs = M('borrow_investor')->field('id')->where("borrow_id={$id} AND (investor_uid={$this->uid} OR borrow_uid={$this->uid})")->find();
         if ($invs['id'] > 0) {
             $invsx = $invs['id'];
         } elseif (!is_array($invs)) {
             $invsx = 'no';
         }
     } else {
         $invsx = 'login';
     }
     $this->assign("invid", $invsx);
     //合同ID
     //borrowinfo
     $borrowinfo = M("borrow_info")->field(true)->find($id);
     if (!is_array($borrowinfo) || $borrowinfo['borrow_status'] == 0 && $this->uid != $borrowinfo['borrow_uid']) {
         $this->error("数据有误");
     }
     $borrowinfo['biao'] = $borrowinfo['borrow_times'];
     $borrowinfo['need'] = $borrowinfo['borrow_money'] - $borrowinfo['has_borrow'];
     $borrowinfo['lefttime'] = $borrowinfo['collect_time'] - time();
     $borrowinfo['progress'] = getFloatValue($borrowinfo['has_borrow'] / $borrowinfo['borrow_money'] * 100, 2);
     $borrowinfo['vouch_progress'] = getFloatValue($borrowinfo['has_vouch'] / $borrowinfo['borrow_money'] * 100, 2);
     $borrowinfo['vouch_need'] = $borrowinfo['borrow_money'] - $borrowinfo['has_vouch'];
     $this->assign("vo", $borrowinfo);
     //borrowinfo
     //此标借款利息还款相关情况
     if ($borrowinfo['repayment_type'] == 2) {
         $money = 100;
         $rate = $borrowinfo['borrow_interest_rate'];
         $month = $borrowinfo['borrow_duration'];
         $monthData['money'] = $money;
         $monthData['year_apr'] = $rate;
         $monthData['duration'] = $month;
         $monthData['type'] = "all";
         $repay_detail = EqualMonth($monthData);
         $this->assign('repay_detail', $repay_detail);
     } elseif ($borrowinfo['repayment_type'] == 3) {
         $money = 100;
         $rate = $borrowinfo['borrow_interest_rate'];
         $month = $borrowinfo['borrow_duration'];
         $monthData['account'] = $money;
         $monthData['year_apr'] = $rate;
         $monthData['month_times'] = $month;
         $monthData['type'] = "all";
         $repay_detail = EqualSeason($monthData);
         $this->assign('repay_detail', $repay_detail);
     } elseif ($borrowinfo['repayment_type'] == 4) {
         $money = 100;
         $rate = $borrowinfo['borrow_interest_rate'];
         $month = $borrowinfo['borrow_duration'];
         $parm['month_times'] = $month;
         $parm['account'] = $money;
         $parm['year_apr'] = $rate;
         $parm['type'] = "all";
         $repay_detail = EqualEndMonth($parm);
         $repay_detail['repayment_money'] = $repay_detail['repayment_account'];
         $this->assign("repay_detail", $repay_detail);
     } elseif ($borrowinfo['repayment_type'] == 1) {
         $repay_detail['repayment_money'] = getFloatValue(100 + 100 * $borrowinfo['borrow_interest_rate'] * $borrowinfo['borrow_duration'] / 100, 2);
         $this->assign('repay_detail', $repay_detail);
     }
     //此标借款利息还款相关情况
     //memberinfo
     $memberinfo = M("members m")->field("m.id,m.customer_name,m.customer_id,m.user_name,m.reg_time,m.credits,fi.*,mi.*")->join("{$pre}member_financial_info fi ON fi.uid = m.id")->join("{$pre}member_info mi ON mi.uid = m.id")->where("m.id={$borrowinfo['borrow_uid']}")->find();
     $areaList = getArea();
     $memberinfo['location'] = $areaList[$memberinfo['province']] . $areaList[$memberinfo['city']];
     $memberinfo['location_now'] = $areaList[$memberinfo['province_now']] . $areaList[$memberinfo['city_now']];
     $this->assign("minfo", $memberinfo);
     //memberinfo
     //vouch_list
     $vouch_list = M("borrow_vouch")->field(true)->where("borrow_id={$id}")->select();
     $this->assign("vouch_list", $vouch_list);
     $this->assign("Vstatus", array(0 => '担保中', 1 => "担保完成"));
     //vouch_list
     //data_list
     $data_list = M("member_data_info")->field('type,add_time,count(status) as num,sum(deal_credits) as credits')->where("uid={$borrowinfo['borrow_uid']} AND status=1")->group('type')->select();
     $this->assign("data_list", $data_list);
     //data_list
     //paying_list
     $paying_list = getMemberBorrow($borrowinfo['borrow_uid']);
     $this->assign("paying_list", $paying_list);
     //paying_list
     //近期还款的投标
     //$time1 = microtime(true)*1000;
     $history = getDurationCount($borrowinfo['borrow_uid']);
     $this->assign("history", $history);
     //$time2 = microtime(true)*1000;
     //echo $time2-$time1;
     //investinfo
     $fieldx = "bi.investor_capital,bi.add_time,m.user_name,bi.is_auto";
     $investinfo = M("borrow_investor bi")->field($fieldx)->join("{$pre}members m ON bi.investor_uid = m.id")->where("bi.borrow_id={$id}")->order("bi.id DESC")->select();
     $this->assign("investinfo", $investinfo);
     //investinfo
     //帐户资金情况
     $this->assign("mainfo", getMinfo($borrowinfo['borrow_uid'], true));
     $this->assign("capitalinfo", getMemberBorrowScan($borrowinfo['borrow_uid']));
     //帐户资金情况
     //评论
     $cmap['tid'] = $id;
     $cmap['is_audit'] = 1;
     //审核通过的评论
     $clist = getCommentList($cmap, 5);
     $this->assign("Bconfig", $Bconfig);
     $this->assign("commentlist", $clist['list']);
     $this->assign("commentpagebar", $clist['page']);
     $this->assign("commentcount", $clist['count']);
     $this->display();
 }
Пример #15
0
 public function index()
 {
     $ucLoing = de_xie($_COOKIE['LoginCookie']);
     setcookie('LoginCookie', '', time() - 10 * 60, "/");
     $this->assign("uclogin", $ucLoing);
     $this->assign("unread", $read = M("inner_msg")->where("uid={$this->uid} AND status=0")->count('id'));
     $vipIdenty = M("vip_apply");
     $this->assign("MinfoDone", getMemberInfoDone($this->uid));
     $mstatus = M('members_status')->field(true)->find($this->uid);
     $memberinfo = M('members')->find($this->uid);
     $rate = 0;
     if ($mstatus["id_status"] == 1) {
         ++$rate;
     }
     if ($mstatus["phone_status"] == 1) {
         ++$rate;
     }
     if ($mstatus["email_status"] == 1) {
         ++$rate;
     }
     if ($mstatus["video_status"] == 1) {
         ++$rate;
     }
     if ($mstatus["face_status"] == 1) {
         ++$rate;
     }
     if ($memberinfo["user_leve"] == 1) {
         ++$rate;
     }
     $this->assign("rate", $rate);
     $this->assign("mstatus", M('members_status')->field(true)->find($this->uid));
     $this->assign("capitalinfo", getMemberBorrowScan($this->uid));
     $this->assign("memberinfo", M('members')->find($this->uid));
     $this->assign("memberdetail", M('member_info')->find($this->uid));
     $_SX = M('investor_detail')->field('deadline,interest,capital')->where("investor_uid = {$this->uid} AND status=7")->order("deadline ASC")->find();
     $toubiaojl = M('borrow_investor')->where("investor_uid={$this->uid}")->sum('reward_money');
     //投标奖励
     $this->assign("toubiaojl", $toubiaojl);
     //投标奖励
     $tuiguangjl = M('member_moneylog')->where("uid={$this->uid} and type=13")->sum('affect_money');
     //推广奖励
     $this->assign("tuiguangjl", $tuiguangjl);
     //推广奖励
     $lastInvest['gettime'] = $_SX['deadline'];
     $lastInvest['interest'] = $_SX['interest'];
     $lastInvest['capital'] = $_SX['capital'];
     $this->assign("lastInvest", $lastInvest);
     $_SX = "";
     $_SX = M('investor_detail')->field('deadline,sum(interest) as interest,sum(capital) as capital')->where("borrow_uid = {$this->uid} AND status=7")->group("borrow_id,sort_order")->order("deadline ASC")->find();
     $lastBorrow['gettime'] = $_SX['deadline'];
     $lastBorrow['interest'] = $_SX['interest'];
     $lastBorrow['capital'] = $_SX['capital'];
     $this->assign("lastBorrow", $lastBorrow);
     $this->assign("kflist", get_admin_name());
     $list = array();
     $pre = C('DB_PREFIX');
     $rule = M('ausers u')->field('u.id,u.qq,u.phone')->join("{$pre}members m ON m.customer_id=u.id")->where("u.is_kf =1 and m.customer_id={$minfo['customer_id']}")->select();
     foreach ($rule as $key => $v) {
         $list[$key]['qq'] = $v['qq'];
         $list[$key]['phone'] = $v['phone'];
     }
     $this->assign("kfs", $list);
     //获取推荐姓名
     $recommend_name = "";
     if (!empty($minfo["recommend_id"]) && $minfo["recommend_id"] > 0) {
         $recommend_user = D("members")->where(array('id' => $minfo["recommend_id"]))->find();
         if (!empty($recommend_user)) {
             $recommend_name = $recommend_user['user_name'];
         }
     }
     $this->assign("recommend_name", $recommend_name);
     //上次登录时间
     $this->assign("login_info", M("member_login")->where("uid={$this->uid}")->order("id desc")->find());
     $this->display();
 }