public function index() { //资金统计 $map = array(); $list = M("member_moneylog")->field('type,sum(affect_money) as money')->where($map)->group('type')->select(); $row = array(); $name = C('MONEY_LOG'); foreach ($list as $v) { $row[$v['type']]['money'] = $v['money'] > 0 ? $v['money'] : $v['money'] * -1; $row[$v['type']]['name'] = $name[$v['type']]; } //最近30天资金统计 $endDate = strtotime("30 days"); $map30 = array(); $map30['status'] = array("in", "7,3,4,5"); $map30['repayment_time'] = 0; $map30['deadline'] = array("elt", $endDate); $statics30 = M("investor_detail")->where($map30)->sum('capital+interest'); $this->assign('statics30', $statics30); //逾期总额 $map1 = array(); $map1['status'] = array("in", "3,5,7"); $map1['repayment_time'] = 0; $map1['deadline'] = array("lt", time()); $row['expired']['money'] = M('investor_detail')->where($map1)->sum('capital+interest'); //逾期率 $expiredrate = $row['expired']['money'] / ($row['17']['money'] - $row['11']['money']) * 100; $normalrate = 100 - $expiredrate; $this->assign('expiredratestr', sprintf("%.2f%%", $expiredrate)); $this->assign('normalratestr', sprintf("%.2f%%", $normalrate)); $this->assign('expiredrate', $expiredrate); $this->assign('normalrate', $normalrate); $this->assign('staticslist', $row); $totalDeals = M("borrow_info")->where("borrow_status >= 6")->count("1"); $this->assign('totalDeals', $totalDeals); //近30天还款情况 $nearlyStartTime = strtotime("-3 days"); $nearlyStartDate = date('Y-m-d', $nearlyStartTime); $nearlyEndTime = strtotime("{$nearlyStartDate} 1 month -1 day"); $nearlyEndDate = date('Y-m-d', $nearlyEndTime); $this->assign('nearlyStartDate', $nearlyStartDate); $this->assign('nearlyEndDate', $nearlyEndDate); $map = array(); $map['d.status'] = array("neq", 0); $map['d.deadline'] = array("between", $nearlyStartTime . ',' . $nearlyEndTime); $nearlylist = getTenderList($map, 20, 10, 'd.deadline asc'); $this->assign('nearlylist', $nearlylist["list"]); $this->assign("pagebar", $nearlylist['page']); $this->display(); }
public function tenddone() { $map['i.investor_uid'] = $this->uid; $map['id.repayment_time'] = array("gt", 0); $map['i.status'] = array("in", "4,5,6"); $list = getTenderList($map, 15, null, 'id.deadline DESC,i.id DESC,id.sort_order'); $this->assign("list", $list['list']); $this->assign("pagebar", $list['page']); $this->assign("total", $list['total_money']); $this->assign("num", $list['total_num']); //$this->display("Public:_footer"); $data['html'] = $this->fetch(); exit(json_encode($data)); }
public function tenddone() { //$map['i.investor_uid'] = $this->uid; // $map['i.status'] = array("in","5,6"); $map['investor_uid'] = $this->uid; $map['status'] = array("in", "5,6"); $list = getTenderList($map, 15); $this->assign("list", $list['list']); $this->assign("pagebar", $list['page']); $this->assign("total", $list['total_money']); $this->assign("num", $list['total_num']); //$this->display("Public:_footer"); $data['html'] = $this->fetch(); exit(json_encode($data)); }
public function zwtendbacking() { $map['investor_uid'] = $this->uid; $map['status'] = 4; $map['Borrow.borrow_type'] = array('neq', 9); $list = getTenderList($map, 8); //-----------------------------add by zw 2015-04-10---start------------------ //显示真实姓名 if (is_array($list['list'])) { foreach ($list['list'] as $key => $val) { $borrow_uid = $val['borrow_uid']; $map = " uid = {$borrow_uid} "; $real_name = M("member_info")->field('real_name')->where($map)->limit(1)->select(); $list['list'][$key]['real_name'] = $real_name[0]['real_name']; unset($real_name); } } //-------------------------------------end------------------------ //$list = $this->getTendBacking(); $this->assign("list", $list['list']); $this->assign("pagebar", $list['page']); $this->assign("total", $list['total_money']); $this->assign("num", $list['total_num']); //$this->display("Public:_footer"); $this->assign('uid', $this->uid); $data['html'] = $this->fetch(); $data['uid'] = $this; exit(json_encode($data)); }
public function tending() { $jsoncode = file_get_contents("php://input"); $arr = array(); $arr = json_decode($jsoncode, ture); 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 (intval($arr['uid']) != $this->uid) { ajaxmsg("用户错误!" . $thsi->uid, 0); } if ($type == 1) { $searchMap['investor_uid'] = $this->uid; $searchMap['id'] = array("gt", $id); $order = "id ASC"; } elseif ($type == 0) { $searchMap['investor_uid'] = $this->uid; $searchMap['id'] = array("lt", $id); $order = "id DESC"; } else { $searchMap['investor_uid'] = $this->uid; $order = "id DESC"; } $map['status'] = 1; $list = getTenderList($searchMap, '', $num, $order); foreach ($list['list'] as $key => $v) { $data[$key]['id'] = $v['id']; $data[$key]['borrow_id'] = $v['borrow_id']; $data[$key]['borrow_user'] = $v['borrow_user']; $data[$key]['invest_time'] = date("Y-m-d", $v['invest_time']); $data[$key]['borrow_money'] = $v['borrow_money']; $data[$key]['borrow_interest_rate'] = $v['borrow_interest_rate']; if ($v['repayment_type' == 1]) { $daytype = '天'; } else { $daytype = '个月'; } $data[$key]['borrow_duration'] = $v['borrow_duration'] . $daytype; $data[$key]['investor_capital'] = $v['investor_capital']; $data[$key]['advance_receive'] = $vo['investor_capital'] + $vo['investor_interest']; } $listt['list'] = $data; ajaxmsg($listt); }
public function tendbacking() { $jsoncode = file_get_contents("php://input"); $arr = array(); $arr = json_decode($jsoncode, ture); if (intval($arr['uid']) != $this->uid) { ajaxmsg("用户错误!" . $this->uid, 0); } $map['investor_uid'] = $this->uid; $map['status'] = 4; $func = (require c("APP_ROOT") . "Common/Apps/function.php"); $list = getTenderList($map, 200); foreach ($list['list'] as $k => $v) { $lists[$k]['id'] = $v['borrow_id']; $lists[$k]['borrow_user'] = $v['borrow_user']; $lists[$k]['investor_capital'] = $v['investor_capital']; $lists[$k]['date'] = $v['back'] . "/" . $v['total']; $lists[$k]['dates'] = date("Y-m-d", $v['repayment_time']); } $listss['list'] = $lists; ajaxmsg($listss, 1); }
public function index() { $per = C('DB_PREFIX'); //公司动态 $parm = array(); $parm['type_id'] = 321; $parm['limit'] = 5; $parm['need_content'] = true; $this->assign("noticeList", getArticleList($parm)); /*//行业动态 /*$parm['type_id'] = 398; $parm['limit'] = 1; $parm['need_content'] = true; $this->assign("buzList",getArticleList($parm));*/ //公司动态 $parm['type_id'] = 396; $parm['limit'] = 5; $parm['need_content'] = true; $this->assign("gsdtList", getArticleList($parm)); //行业新闻 /*//粤商动态 $parm['type_id'] = 396; $parm['limit'] = 17; $parm['need_content'] = true; $this->assign("trendList",getArticleList($parm)); //粤商动态*/ /*//最新功能 $parm = array(); $parm['type_id'] = 395; $parm['limit'] = 8; $this->assign("newestFunctionList",getArticleList($parm)); //最新功能*/ //常见问题 $parm = array(); $parm['type_id'] = 392; $parm['limit'] = 6; $this->assign("questionList", getArticleList($parm)); //常见问题 //首页动态图片新闻 $this->assign("picnew", M("article")->where("is_homepicnews=1 and type_id=396")->order("id desc")->find()); //首页动态图片新闻 //首页行业图片新闻 $this->assign("buzpicnew", M("article")->where("is_homepicnews=1 and type_id=338")->order("id desc")->find()); //首页行业图片新闻 //成功的借款 $parm = array(); $searchMap = array(); $searchMap['b.borrow_status'] = array("in", '6,7'); $parm['map'] = $searchMap; $parm['limit'] = 3; $parm['orderby'] = "b.id DESC"; $successBorrow = getBorrowList($parm); $this->assign("successBorrow", $successBorrow); //成功的借款 //逾期的借款 $parm = array(); $searchMap = array(); $searchMap['borrow_status'] = 8; $parm['map'] = $searchMap; $parm['limit'] = 3; $parm['orderby'] = "b.id DESC"; $breakBorrow = getBorrowList($parm); $this->assign("breakBorrow", $breakBorrow); //逾期的借款 //正在进行的贷款 $searchMap = array(); $searchMap['borrow_status'] = array("in", '2,4,6,7'); $Bconfig = (require C("APP_ROOT") . "Conf/borrow_config.php"); $parm = array(); date_default_timezone_set('Asia/Shanghai'); $ntime = date('Y-m-d H:i:s'); $searchMap['schedular_time'] = array("LT", $ntime); $parm['map'] = $searchMap; $parm['limit'] = 5; $parm['orderby'] = "b.borrow_status ASC,b.id DESC"; $listBorrow = getBorrowList($parm); $this->assign("Bconfig", $Bconfig); $this->assign("listBorrow", $listBorrow); //正在进行的贷款 //可投标的借款 $searchMap = array(); $searchMap['borrow_status'] = array("in", '2'); $parm = array(); $parm['map'] = $searchMap; $this->assign("doingnum", getBorrowList($parm, true)); //可投标的借款 //最热借款 $searchMap = array(); $searchMap['borrow_status'] = array("in", '6,7,8,9'); $searchMap['full_time'] = array("gt", 0); $parm = array(); $parm['map'] = $searchMap; $parm['limit'] = 10; $parm['hotest'] = true; $parm['orderby'] = "IFNULL(b.`full_time`,0)-IFNULL(bv.`deal_time`,0) ASC"; $listBorrowHotest = getBorrowList($parm); $this->assign("listBorrowHotest", $listBorrowHotest); //最热借款 //推荐的贷款 $searchMap = array(); $searchMap['borrow_status'] = array("in", '2,4,6,7'); $searchMap['is_tuijian'] = 1; //$searchMap['collect_time']=array('gt',time()); $parm = array(); $parm['map'] = $searchMap; $parm['limit'] = 1; $parm['orderby'] = "b.id DESC"; $listBorrowtj = getBorrowList($parm); $this->assign("listBorrow_tj", $listBorrowtj); //推荐的贷款 $this->assign("mcount", M("members")->count("id")); $this->assign("mborrowOut", M("borrow_info")->where("borrow_status in(6,7,8,9)")->sum("borrow_money")); $this->assign("mborrowOutNum", M("borrow_info")->where("borrow_status in(6,7,8,9)")->count("id")); //地区文章列表 $artList = getAreaTypeList(array("limit" => 7, "area_id" => $this->siteInfo['id'], 'type_id' => 0)); $this->assign("newlist", $artList); //地区文章列表 if ($this->uid) { $this->assign("m_minfo", M('members')->field('credits')->find($this->uid)); $this->assign("unread", $read = M("inner_msg")->where("uid={$this->uid} AND status=0")->count('id')); } //近期投资 $this->assign("recentList", getRecentList(10)); //近期还款 $nearlyStartTime = strtotime("-3 days"); $nearlyStartDate = date('Y-m-d', $nearlyStartTime); $nearlyEndTime = strtotime("{$nearlyStartDate} 1 month -1 day"); $map = array(); $map['d.status'] = array("neq", 0); $map['d.deadline'] = array("between", $nearlyStartTime . ',' . $nearlyEndTime); $nearlylist = getTenderList($map, null, 10, 'd.deadline asc'); $this->assign("recentPayList", $nearlylist['list']); //////////////////////////排行榜////////////////// $map = array(); $start = strtotime(date("Y-m-d", time()) . " 00:00:00"); $end = strtotime(date("Y-m-d", time()) . " 23:59:59"); $map['add_time'] = array("between", "{$start},{$end}"); $listPmday = getranklist($map, 10); $this->assign("pmDay", $listPmday); $map = array(); $start = strtotime("-7 day", strtotime(date("Y-m-d", time()) . " 00:00:00")); //strtotime(date("Y-m-d",time())." 00:00:00"); $end = strtotime(date("Y-m-d", time()) . " 23:59:59"); $map['add_time'] = array("between", "{$start},{$end}"); $listPmweek = getranklist($map, 10); $this->assign("pmWeek", $listPmweek); $map = array(); $xdat = explode("|", $this->glo['rankDate']); $start = strtotime($xdat[0] . " 00:00:00"); $end = strtotime($xdat[1] . " 23:59:59"); $map['add_time'] = array("between", "{$start},{$end}"); $listPmMonth = getranklist($map, 10); $this->assign("pmMonth", $listPmMonth); //资金统计 $map = array(); $list = M("member_moneylog")->field('type,sum(affect_money) as money')->where($map)->group('type')->select(); $row = array(); $name = C('MONEY_LOG'); foreach ($list as $v) { $row[$v['type']]['money'] = $v['money'] > 0 ? $v['money'] : $v['money'] * -1; $row[$v['type']]['name'] = $name[$v['type']]; } $this->assign('staticslist', $row); //理财产品 //$financial_arr = getFinancialData(); //$this->assign('financial_arr',$financial_arr); //////////////////////////////////////////// $this->display(); /****************************募集期内标未满,自动流标 新增 2013-03-13****************************/ //流标返回 $mapT = array(); $mapT['collect_time'] = array("lt", time()); $mapT['borrow_status'] = 2; $tlist = M("borrow_info")->field("id,borrow_uid,borrow_type,borrow_money,first_verify_time,borrow_interest_rate,borrow_duration,repayment_type,collect_day,collect_time")->where($mapT)->select(); if (empty($tlist)) { exit; } foreach ($tlist as $key => $vbx) { $borrow_id = $vbx['id']; //流标 $done = false; $borrowInvestor = D('borrow_investor'); $binfo = M("borrow_info")->field("borrow_type,borrow_money,borrow_uid,borrow_duration,repayment_type")->find($borrow_id); $investorList = $borrowInvestor->field('id,investor_uid,investor_capital')->where("borrow_id={$borrow_id}")->select(); M('investor_detail')->where("borrow_id={$borrow_id}")->delete(); if ($binfo['borrow_type'] == 1) { $limit_credit = memberLimitLog($binfo['borrow_uid'], 12, $binfo['borrow_money'], $info = "{$binfo['id']}号标流标"); } //返回额度 $borrowInvestor->startTrans(); $bstatus = $type = 3; $upborrow_info = M('borrow_info')->where("id={$borrow_id}")->setField("borrow_status", $bstatus); //处理借款概要 $buname = M('members')->getFieldById($binfo['borrow_uid'], 'user_name'); //处理借款概要 if (is_array($investorList)) { $upsummary_res = M('borrow_investor')->where("borrow_id={$borrow_id}")->setField("status", $type); foreach ($investorList as $v) { MTip('chk15', $v['investor_uid'], $borrow_id); //sss $accountMoney_investor = M("member_money")->field(true)->find($v['investor_uid']); $datamoney_x['uid'] = $v['investor_uid']; $datamoney_x['type'] = 8; $datamoney_x['affect_money'] = $v['investor_capital']; $datamoney_x['account_money'] = $accountMoney_investor['account_money'] + $datamoney_x['affect_money']; $datamoney_x['collect_money'] = $accountMoney_investor['money_collect']; $datamoney_x['freeze_money'] = $accountMoney_investor['money_freeze'] - $datamoney_x['affect_money']; //会员帐户 $mmoney_x['money_freeze'] = $datamoney_x['freeze_money']; $mmoney_x['money_collect'] = $datamoney_x['collect_money']; $mmoney_x['account_money'] = $datamoney_x['account_money']; //会员帐户 $_xstr = "募集期内标未满,流标"; $datamoney_x['info'] = "第{$borrow_id}号标" . $_xstr . ",返回冻结资金"; $datamoney_x['add_time'] = time(); $datamoney_x['add_ip'] = get_client_ip(); $datamoney_x['target_uid'] = $binfo['borrow_uid']; $datamoney_x['target_uname'] = $buname; $moneynewid_x = M('member_moneylog')->add($datamoney_x); if ($moneynewid_x) { $bxid = M('member_money')->where("uid={$datamoney_x['uid']}")->save($mmoney_x); } } } else { $moneynewid_x = true; $bxid = true; $upsummary_res = true; } if ($moneynewid_x && $upsummary_res && $bxid && $upborrow_info) { $done = true; $borrowInvestor->commit(); } else { $borrowInvestor->rollback(); } if (!$done) { continue; } MTip('chk11', $vbx['borrow_uid'], $borrow_id); $verify_info['borrow_id'] = $borrow_id; $verify_info['deal_info_2'] = text($_POST['deal_info_2']); $verify_info['deal_user_2'] = 0; $verify_info['deal_time_2'] = time(); $verify_info['deal_status_2'] = 3; if ($vbx['first_verify_time'] > 0) { M('borrow_verify')->save($verify_info); } else { M('borrow_verify')->add($verify_info); } $vss = M("members")->field("user_phone,user_name")->where("id = {$vbx['borrow_uid']}")->find(); SMStip("refuse", $vss['user_phone'], array("#USERANEM#", "ID"), array($vss['user_name'], $verify_info['borrow_id']), $verify_info['borrow_id'], array($vbx['borrow_uid'])); //@SMStip("refuse",$vss['user_phone'],array("#USERANEM#","ID"),array($vss['user_name'],$verify_info['borrow_id'])); //updateBinfo $newBinfo = array(); $newBinfo['id'] = $borrow_id; $newBinfo['borrow_status'] = 3; $newBinfo['second_verify_time'] = time(); $x = M("borrow_info")->save($newBinfo); } /****************************募集期内标未满,自动流标 新增 2013-03-13****************************/ }
<div class="m-t-10"> <p class="text-black">还款方式</p> <p class="text-success"><?php echo ($Bconfig['REPAYMENT_TYPE'][$vb['repayment_type']]); ?></p> </div> </div> </div> </div></div><?php endforeach; endif; else: echo "" ;endif; ?> </div> <div class="pages badoo"><?php echo ($list["page"]); ?></div> <!-- Left // --> </div> <?php $parm = array(); $parm['type_id'] = 392; $parm['limit'] = 6; $questionList = getArticleList($parm); $recentList = getRecentList(10); $nearlyStartTime = strtotime("-3 days"); $nearlyStartDate = date('Y-m-d', $nearlyStartTime); $nearlyEndTime = strtotime("$nearlyStartDate 1 month -1 day"); $map = array(); $map['d.status'] = array("neq", 0); $map['d.deadline'] = array("between", $nearlyStartTime.','.$nearlyEndTime); $nearlylist = getTenderList($map, null, 10, 'd.deadline asc'); $recentPayList = $nearlylist['list']; ?> <div id="right"> <!-- Right --> <div id="rb1"> <div id="rb1_upper"> <div id="rb1_upper_l"></div> <div id="rb1_upper_r"><h3>诚 一站式金融服务平台</h3><p>低风险,收益率适中投资理财服务</p></div> </div> <div class="rb1_bo1"> <h4>诚信担保</h4> <p>- 所有的投资项目均有第三方担保</p> <p>- 100%本金和收益保障</p> </div> <div class="rb1_bo2"> <h4>轻松愉快的投资过程</h4>