コード例 #1
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'));
     $this->assign("mstatus", M('members_status')->field(true)->find($this->uid));
     $minfo = getMinfo($this->uid, true);
     $pin_pass = $minfo['pin_pass'];
     $has_pin = empty($pin_pass) ? "no" : "yes";
     $this->assign("has_pin", $has_pin);
     $this->assign("memberinfo", M('members')->find($this->uid));
     $this->assign("memberdetail", M('member_info')->find($this->uid));
     $this->assign("minfo", $minfo);
     $this->assign('benefit', get_personal_benefit($this->uid));
     $this->assign('out', get_personal_out($this->uid));
     $this->assign("bank", M('member_banks')->field('bank_num')->find($this->uid));
     $info = getMemberDetail($this->uid);
     $this->assign("info", $info);
     $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=0")->select();
     //m.customer_id={$minfo['customer_id']}
     foreach ($rule as $key => $v) {
         $list[$key]['qq'] = $v['qq'];
         $list[$key]['phone'] = $v['phone'];
     }
     $this->assign("kfs", $list);
     $_SX = M('investor_detail')->field('deadline,interest,capital')->where("investor_uid = {$this->uid} AND status=7")->order("deadline ASC")->find();
     $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);
     $map = array();
     $map['uid'] = $this->uid;
     $Log_list = getMoneyLog($map, 4);
     $this->assign("Log_list", $Log_list['list']);
     $this->assign("list", get_personal_count($this->uid));
     $this->assign("uid", $map['uid']);
     $this->display();
 }
コード例 #2
0
 public function zjxx()
 {
     $jsoncode = file_get_contents("php://input");
     //alogsm("zjxx",0,1,session("u_id").$jsoncode);
     $minfo = getMinfo($this->uid, true);
     //$this->assign("memberinfo", M('members')->find($this->uid));
     //$this->assign("minfo",$minfo);
     //$this->assign('benefit', get_personal_benefit($this->uid));
     //$this->assign('out', get_personal_out($this->uid));
     $benefit = get_personal_benefit($this->uid);
     $this->assign("bank", M('member_banks')->field('bank_num')->find($this->uid));
     $info = getMemberDetail($this->uid);
     $this->assign("info", $info);
     $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);
     $_SX = M('investor_detail')->field('deadline,interest,capital')->where("investor_uid = {$this->uid} AND status=7")->order("deadline ASC")->find();
     $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("memberdetail", M('member_info')->find($this->uid));
     //$this->assign("list",get_personal_count($this->uid));
     $list = get_personal_count($this->uid);
     //新加开始
     $_list['zichanzonge'] = $minfo['account_money'] + $minfo['back_money'] + $minfo['money_collect'] + $minfo['money_freeze'];
     $_list['keyongyue'] = $minfo['account_money'] + $minfo['back_money'];
     $_list['money_freeze'] = $minfo['money_freeze'] != null ? $minfo['money_freeze'] : "0.00";
     $_list['dsbx'] = $minfo['money_collect'];
     $_list['willgetInterest'] = $benefit['interest_collection'];
     $_list['withdraw_money'] = $list['withdraw'] != null ? $list['withdraw'] : "0.00";
     $_list['chongzhizonge'] = $list['payonline'] != null ? $list['payonline'] : "0.00";
     $_list['zuijindaihuanjine'] = getFloatvalue($lastBorrow['interest'] + $lastBorrow['capital'], 2);
     if ($lastBorrow['gettime'] > 0) {
         $_list['zuijindaihuantime'] = date("Y-m-d", $lastBorrow['gettime']);
     } else {
         $_list['zuijindaihuantime'] = "无待还";
     }
     $_list['zuijindaishoujine'] = getFloatvalue($lastInvest['capital'] + $lastInvest['interest'], 2);
     if ($lastInvest['gettime'] > 0) {
         $_list['zuijindaishoutime'] = date("Y-m-d", $lastInvest['gettime']);
     } else {
         $_list['zuijindaishoutime'] = "无待还";
     }
     echo ajaxmsg($_list);
     //$this->display();
 }
コード例 #3
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);
     }
 }
コード例 #4
0
ファイル: IndexAction.class.php プロジェクト: GStepOne/CI
 public function index()
 {
     //	$this->duizhang();
     $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'));
     $this->assign("mstatus", M('members_status')->field(true)->find($this->uid));
     $danbao = M('borrow_investor')->where("borrow_uid=" . $this->uid)->sum("guar_fee");
     $this->assign("danbao", $danbao);
     //die(M()->getlastsql());
     //echo $danbao;exit;
     //查询会员状态
     $vip_status = M("members_status as ms")->field("ms.phone_status,ms.id_status,ms.email_status,ms.safequestion_status,lmb.uid")->join("left join lzh_member_banks as lmb on ms.uid=lmb.uid")->where('ms.uid=' . $this->uid)->find();
     $this->vip = $vip_status;
     $minfo = getMinfo($this->uid, true);
     $pin_pass = $minfo['pin_pass'];
     $has_pin = empty($pin_pass) ? "no" : "yes";
     $this->assign("has_pin", $has_pin);
     $this->assign("memberinfo", M('members')->find($this->uid));
     $this->assign("memberdetail", M('member_info')->find($this->uid));
     $this->assign("minfo", $minfo);
     //加上新手标的利息 2015-09-18
     $benefit = get_personal_benefit($this->uid);
     //dump($benefit);
     //查询新手标的代收利息
     $newbieinterest = M('newbie_record')->field('interest')->where('investid=' . $this->uid . ' and status=4')->find();
     //echo M()->getLastSql();
     $benefit['interest_collection'] = $benefit['interest_collection'] + $newbieinterest['interest'];
     $this->assign('benefit', $benefit);
     //var_dump(get_personal_benefit($this->uid));
     $this->assign('out', get_personal_out($this->uid));
     $this->assign("bank", M('member_banks')->field('bank_num')->find($this->uid));
     $info = getMemberDetail($this->uid);
     $this->assign("info", $info);
     $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);
     $_SX = M('investor_detail')->field('deadline,interest,capital')->where("investor_uid = {$this->uid} AND status=7")->order("deadline ASC")->find();
     $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);
     $map = array();
     $map['uid'] = $this->uid;
     $Log_list = getMoneyLog($map, 4);
     $this->assign("Log_list", $Log_list['list']);
     $this->assign("list", get_personal_count($this->uid));
     //以下是我的投资详细
     $zwmap['investor_uid'] = $this->uid;
     $zwmap['status'] = 4;
     $zwmap['Borrow.borrow_type'] = array('neq', 9);
     $zwlist = getTenderList($zwmap, 1);
     //显示真实姓名
     if (is_array($zwlist['list'])) {
         foreach ($zwlist['list'] as $zwkey => $zwval) {
             $borrow_uid = $zwval['borrow_uid'];
             $zwmap = " uid = {$borrow_uid} ";
             $real_name = M("member_info")->field('real_name')->where($zwmap)->limit(1)->select();
             $zwlist['list'][$zwkey]['real_name'] = $real_name[0]['real_name'];
             unset($real_name);
         }
     }
     //曲线走势图
     $result = M("month_detail")->where("user_id=" . $this->uid)->find();
     //去掉前三个
     $res = array_slice($result, 3);
     foreach ($res as $key => $value) {
         $arr[] = $value;
     }
     if (max($arr) >= 10000) {
         foreach ($arr as $key => $value) {
             $brr[] = $value / 10000;
         }
         $this->char = "万元";
     } else {
         if (max($arr) >= 1000) {
             foreach ($arr as $key => $value) {
                 $brr[] = $value / 1000;
             }
             $this->char = "千元";
         } else {
             if (max($arr) >= 100) {
                 foreach ($arr as $key => $value) {
                     $brr[] = $value / 100;
                 }
                 $this->char = "百元";
             } else {
                 foreach ($arr as $key => $value) {
                     $brr[] = $value;
                 }
                 $this->char = "元";
             }
         }
     }
     if (count($brr) == 0) {
         $brr = array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
         $this->char = "元";
     }
     $brr = json_encode($brr);
     $this->arr = $brr;
     //传输到前端
     //日历数据 具体日期具体还款
     $month = date('m');
     $firstday = date('Y-' . $month . '-01 00:00:00');
     $firstsec = strtotime(date('Y-' . $month . '-01 00:00:00'));
     //零点零分零秒
     $lastsec = strtotime(date('Y-m-d  23:59:59', strtotime($firstday . "+1 month -1 day")));
     //要查询的月末
     $investor_uid = $this->uid;
     //借款编号  借款者id 应收本金 应收利息  利息管理费 标的状态 还款时间 逾期罚金 借款者真实姓名
     $caldata = M('investor_detail as lid')->field('lid.capital,lid.interest,lid.interest_fee,lid.deadline,lid.expired_money')->join("LEFT JOIN lzh_member_info as lmi on lid.borrow_uid = lmi.uid")->where("lid.investor_uid=" . $investor_uid . " and lid.repayment_time = '0' and lid.deadline>" . $firstsec . " and lid.deadline<" . $lastsec)->order('lid.deadline')->select();
     foreach ($caldata as $key => $value) {
         $calender[] = array(date('md', $value['deadline']), $value['capital'] + $value['interest'] + $value['expired_money'] - $value['interest_fee']);
     }
     $temp = array();
     foreach ($calender as $key => $value) {
         $key = $value['0'];
         $temp[$key] = isset($temp[$key]) ? $value['1'] + $temp[$key] : $value['1'];
     }
     foreach ($temp as $key => $value) {
         //$result[] = array('date' => $key, 'money' => $value);
         $result[] = array($key => $value);
     }
     $res = array_slice($result, 15);
     foreach ($res as $key => $value) {
         foreach ($value as $k => $v) {
             $ali[] = $k . '&' . $v;
         }
     }
     $this->ali = json_encode($ali);
     //最新日历数据遍历
     // echo "<pre/>";var_dump($ali);
     //日历结束
     //推荐项目
     //正在进行的贷款
     $searchMap = array();
     $searchMap['Borrow.borrow_status'] = array("eq", '2');
     $searchMap['Borrow.is_tuijian'] = array("in", '0,1');
     $searchMap['Borrow.borrow_type'] = array("neq", 9);
     $searchMap['Borrow.is_new'] = array("eq", 0);
     $listBorrow = getBorrowList($searchMap, 3);
     $this->listBorrow = $listBorrow;
     $this->assign("list", $zwlist['list']);
     $this->assign("pagebar", $zwlist['page']);
     $this->assign('uid', $this->uid);
     //我的投资结束
     $this->display();
 }
コード例 #5
0
 public function post()
 {
     if (!$this->uid) {
         $this->error("请先登陆", __APP__ . "/member/common/login");
     }
     $vminfo = M('members')->field("user_leve,time_limit,is_borrow,is_vip")->find($this->uid);
     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) {
             $this->error("您有一个借款中的标,请等待审核", __APP__ . "/member/borrowin#fragment-1");
         }
         if (!($vminfo['user_leve'] > 0 && $vminfo['time_limit'] > time())) {
             $this->error("请先通过VIP审核再发标", __APP__ . "/member/vip");
         }
         if ($vminfo['is_borrow'] == 0) {
             $this->error("您目前不允许发布借款,如需帮助,请与客服人员联系!");
             $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) {
             $this->error("请先填写个人详细资料后再发标", __APP__ . "/member/memberinfo#fragment-1");
         }
     }
     $gtype = text($_GET['type']);
     $vkey = md5(time() . $gtype);
     // 		dump($gtype);
     // 		die;
     switch ($gtype) {
         case "normal":
             //普通标
             $borrow_type = 1;
             break;
         case "vouch":
             //新担保标
             $borrow_type = 2;
             break;
         case "second":
             //秒还标
             $this->assign("miao", 'yes');
             $borrow_type = 3;
             break;
         case "net":
             //净值标
             $borrow_type = 4;
             break;
         case "mortgage":
             //抵押标
             $borrow_type = 5;
             break;
     }
     $ck = cookie($vkey, $borrow_type, 3600);
     $borrow_duration_day = explode("|", $this->glo['borrow_duration_day']);
     $day = range($borrow_duration_day[0], $borrow_duration_day[1]);
     $day_time = array();
     foreach ($day as $v) {
         $day_time[$v] = $v . "天";
     }
     $borrow_duration = explode("|", $this->glo['borrow_duration']);
     $month = range($borrow_duration[0], $borrow_duration[1]);
     $month_time = array();
     foreach ($month as $v) {
         $month_time[$v] = $v . "个月";
     }
     //var_dump( $this->gloconf);
     $rate_lixt = explode("|", $this->glo['rate_lixi']);
     $borrow_config = (require C("APP_ROOT") . "Conf/borrow_config.php");
     $this->assign("borrow_use", $this->gloconf['BORROW_USE']);
     $this->assign("borrow_min", $this->gloconf['BORROW_MIN']);
     $this->assign("borrow_max", $this->gloconf['BORROW_MAX']);
     $this->assign("borrow_time", $this->gloconf['BORROW_TIME']);
     $this->assign("BORROW_TYPE", $borrow_config['BORROW_TYPE']);
     $this->assign("borrow_type", $borrow_type);
     $this->assign("borrow_day_time", $day_time);
     $this->assign("borrow_month_time", $month_time);
     $this->assign("repayment_type", $borrow_config['REPAYMENT_TYPE']);
     $this->assign("borrow_btype", $borrow_config['BORROW_BTYPE']);
     $this->assign("vkey", $vkey);
     $this->assign("rate_lixt", $rate_lixt);
     $this->display();
 }
コード例 #6
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'));
     $this->assign("mstatus", M('members_status')->field(true)->find($this->uid));
     //注册奖励,投了月标才可以得到
     $get_data = M('global')->field("text")->where("code = 'is_reward'")->find();
     $is_new = $get_data['text'];
     if ($is_new == '1') {
         $reward = M('borrow_investor')->field("borrow_id")->where("investor_uid = {$this->uid}")->select();
         foreach ($reward as $key => $v) {
             $borrow_type = M('borrow_info')->where("id = {$v['borrow_id']}")->find();
             if ($borrow_type['borrow_type'] != 3) {
                 $rewards = M('members')->field("reward_zhuce")->where("id = {$this->uid} and is_new = 1")->find();
                 if ($rewards['reward_zhuce'] == 0.0) {
                     $get_data = M('global')->field("text")->where("code = 'nomb_reward'")->find();
                     $data['reward_zhuce'] = $get_data['text'];
                     //$data['is_new'] = 2;
                     $status = M('members')->where("id = {$this->uid} and is_new = 1")->save($data);
                     if ($status) {
                         $member_money = M("member_money")->where("uid = {$this->uid}")->find();
                         $members_money['account_money'] = $member_money['account_money'] + $data['reward_zhuce'];
                         $result = M("member_money")->where("uid = {$this->uid}")->save($members_money);
                     }
                     if ($result) {
                         $logs = M("member_money")->where("uid = {$this->uid}")->find();
                         $log['uid'] = $this->uid;
                         $log['type'] = 49;
                         $log['affect_money'] = $data['reward_zhuce'];
                         $log['account_money'] = $logs['account_money'];
                         $log['back_money'] = $logs['back_money'];
                         $log['collect_money'] = $logs['money_collect'];
                         $log['freeze_money'] = $logs['money_freeze'];
                         $log['info'] = "新用户注册奖励";
                         $log['add_time'] = time();
                         $log['add_ip'] = get_client_ip();
                         $log['target_uid'] = 0;
                         $log['target_uname'] = "手投网平台";
                         $rn = M('member_moneylog')->add($log);
                         break;
                     }
                 }
             }
         }
     }
     $reward_zhuce = M("members")->field("reward_zhuce")->where("id = {$this->uid}")->find();
     $this->assign("reward_zhuce", $reward_zhuce['reward_zhuce']);
     $minfo = getMinfo($this->uid, true);
     $pin_pass = $minfo['pin_pass'];
     $has_pin = empty($pin_pass) ? "no" : "yes";
     $this->assign("has_pin", $has_pin);
     $this->assign("memberinfo", M('members')->find($this->uid));
     $this->assign("memberdetail", M('member_info')->find($this->uid));
     $this->assign("minfo", $minfo);
     $this->assign('benefit', get_personal_benefit($this->uid));
     $this->assign('out', get_personal_out($this->uid));
     $this->assign("bank", M('member_banks')->field('bank_num')->find($this->uid));
     $info = getMemberDetail($this->uid);
     $this->assign("info", $info);
     $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);
     $_SX = M('investor_detail')->field('deadline,interest,capital')->where("investor_uid = {$this->uid} AND status=7")->order("deadline ASC")->find();
     $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);
     if (ListMobile()) {
         if ($this->uid && M('members')->where('id=' . $this->uid . ' and ent=1')->count()) {
             $redbag = M('redbag')->order('id desc')->where('status=1')->find();
             //判断活动是否存在
             $rid = $redbag['id'];
             if ($rid) {
                 $usered = M('redbag_list')->where('uid=' . $this->uid . ' and pid=' . $rid)->count();
                 //判断是否领过红包
                 if (!$usered) {
                     $redinfo = M('redbag_list')->order('id asc')->where('uid=0 and pid=' . $rid . ' and status=1')->find();
                     //判断是否还有剩余红包
                     if ($redinfo) {
                         $this->assign('isredbag', true);
                     }
                 }
             }
         }
     }
     $map = array();
     $map['uid'] = $this->uid;
     $Log_list = getMoneyLog($map, 4);
     $this->assign("Log_list", $Log_list['list']);
     $this->assign("list", get_personal_count($this->uid));
     $this->display();
 }