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(); }
/** * 资金信息 */ public function fund() { $this->assign('pcount', get_personal_count($this->uid)); $this->assign('benefit', get_personal_benefit($this->uid)); //收入 $minfo = getMinfo($this->uid, true); $this->assign("minfo", $minfo); $this->display(); }
public function summary($re = false) { $vlist = getMemberMoneySummary($this->uid); $this->assign("vo", $vlist); $this->assign('pcount', get_personal_count($this->uid)); $minfo = getMinfo($this->uid, true); $this->assign("minfo", $minfo); $this->assign('benefit', get_personal_benefit($this->uid)); //收入 $this->assign('out', get_personal_out($this->uid)); //支出 //////////////////////////////////////////////////////////////////// $data['html'] = $this->fetch(); exit(json_encode($data)); }
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(); }
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(); }
/** +---------------------------------------------------------- * 默认操作 +---------------------------------------------------------- */ public function index() { $map = array(); if ($_REQUEST['uname']) { $map['m.user_name'] = array("like", urldecode($_REQUEST['uname']) . "%"); $search['uname'] = urldecode($_REQUEST['uname']); } if ($_REQUEST['realname']) { $map['mi.real_name'] = urldecode($_REQUEST['realname']); $search['realname'] = $map['mi.real_name']; } if (!empty($_REQUEST['bj']) && !empty($_REQUEST['lx']) && !empty($_REQUEST['money'])) { if ($_REQUEST['lx'] == 'allmoney') { if ($_REQUEST['bj'] == 'gt') { $bj = '>'; } else { if ($_REQUEST['bj'] == 'lt') { $bj = '<'; } else { if ($_REQUEST['bj'] == 'eq') { $bj = '='; } } } $map['_string'] = "(mm.account_money+mm.back_money) " . $bj . $_REQUEST['money']; } else { $map[$_REQUEST['lx']] = array($_REQUEST['bj'], $_REQUEST['money']); } $search['bj'] = $_REQUEST['bj']; $search['lx'] = $_REQUEST['lx']; $search['money'] = $_REQUEST['money']; } //分页处理 import("ORG.Util.Page"); $count = M('members m')->join("{$this->pre}member_money mm ON mm.uid=m.id")->join("{$this->pre}member_info mi ON mi.uid=m.id")->where($map)->count('m.id'); $p = new Page($count, C('ADMIN_PAGE_SIZE')); $page = $p->show(); $Lsql = "{$p->firstRow},{$p->listRows}"; //分页处理 $pre = $this->pre; $field = 'm.id,m.reg_time,m.user_name,mi.real_name,mm.money_freeze,mm.money_collect,(mm.account_money+mm.back_money) total_money,mm.account_money,mm.back_money'; $list = M('members m')->field($field)->join("{$this->pre}member_money mm ON mm.uid=m.id")->join("{$this->pre}member_info mi ON mi.uid=m.id")->where($map)->limit($Lsql)->order("m.id DESC")->select(); foreach ($list as $key => $v) { $uid = $v['id']; $list[$key]['benefit'] = get_personal_benefit($uid); $list[$key]['out'] = get_personal_out($uid); $list[$key]['count'] = get_personal_count($uid); $money_log = get_money_log($uid); $list[$key]['glycz'] = $money_log['17']['money']; $withdraw0 = M('member_withdraw')->where("uid={$uid} AND withdraw_status=0")->sum('withdraw_money'); //待提现 $withdraw1 = M('member_withdraw')->where("uid={$uid} AND withdraw_status=1")->sum('withdraw_money'); //提现处理中 $withdraw3 = M('member_withdraw')->where("uid={$uid} AND withdraw_status=0")->sum('second_fee'); //待提现手续费 $withdraw4 = M('member_withdraw')->where("uid={$uid} AND withdraw_status=1")->sum('second_fee'); //处理中提现手续费 $list[$key]['dshtx'] = $withdraw0 + $withdraw3; $list[$key]['chulizhong'] = $withdraw1 + $withdraw4; } $this->assign("bj", array("gt" => '大于', "eq" => '等于', "lt" => '小于')); $this->assign("lx", array("allmoney" => '可用余额', "mm.money_freeze" => '冻结金额', "mm.money_collect" => '待收金额')); $this->assign("list", $list); $this->assign("pagebar", $page); $this->assign("search", $search); $this->assign("query", http_build_query($search)); $this->display(); }
public function verify() { $jsoncode = file_get_contents("php://input"); $arr = array(); $arr = json_decode($jsoncode, true); //ajaxmsg($this->uid); //var_dump($a);die; if (!is_array($arr) || empty($arr) || $arr['uid'] == "") { ajaxmsg("数据有误", 0); } if ($arr['uid'] != $this->uid) { ajaxmsg("您还未登陆,请先登陆!", 0); } $userinfo = M("members")->field('user_name')->where("id={$this->uid}")->find(); $mess = array(); $mess['uid'] = $this->uid; $mess['username'] = $userinfo['user_name']; $mess['head'] = get_avatar($mess['uid']); //头像 $minfo = getMinfo($mess['uid'], true); $mess['credits'] = getLeveIco($minfo['credits'], 3); //会员等级 $membermoney = M("member_money")->field(true)->where("uid={$mess['uid']}")->find(); if (is_array($membermoney)) { $mess['mayuse'] = $membermoney['account_money'] + $membermoney['back_money']; //可用 $mess['freeze'] = $membermoney['money_freeze']; //冻结 $mess['collect'] = $membermoney['money_collect']; //代收 $mess['total'] = $mess['mayuse'] + $mess['freeze'] + $mess['collect']; //总额 $lixi = get_personal_benefit($this->uid); $mess['benefit'] = $lixi['interest_collection']; } else { $mess['total'] = 0; $mess['mayuse'] = 0; $mess['freeze'] = 0; $mess['collect'] = 0; $mess['benefit'] = 0; } $pre = C('DB_PREFIX'); $vo = M("members m")->field("m.user_email,m.user_phone,m.id,m.user_leve,m.time_limit,s.id_status,s.phone_status,s.email_status,s.video_status,s.face_status")->join("{$pre}members_status s ON s.uid=m.id")->where("m.id={$this->uid}")->find(); $str = ""; if ($vo['id_status'] == 1) { $mess['id_status'] = 1; $vm = M("member_info")->field('idcard,real_name')->find($mess['uid']); $mess['real_name'] = $vm['real_name']; $mess['idcard'] = hidecard($vm['idcard'], 1); } elseif ($vo['id_status'] == 3) { $mess['id_status'] = 2; } else { $mess['id_status'] = 0; } if ($vo['phone_status'] == 1) { $mess['phone_status'] = 1; $mess['phone'] = hidecard($vo['user_phone'], 2); } else { $mess['phone_status'] = 0; } if ($vo['email_status'] == 1) { $mess['email_status'] = 1; $mess['email'] = $vo['user_email']; } else { $mess['email_status'] = 0; $mess['email'] = $vo['user_email']; } // if(M('escrow_account')->where("uid={$this->uid}")->count('uid')){ // // ajaxmsg('您已经绑定了托管账户,无需重复绑定',0); // $mess['escrow']=1; // }else{ // $mess['escrow']=0; // } $minfo = getMinfo($this->uid, true); $user_name = session('u_user_name'); //$this->assign("minfo",$minfo); $mess['credits'] = getLeveIco($minfo['credits'], 3); $mess['credit_cuse'] = $minfo['credit_cuse']; $mess['borrow_vouch_cuse'] = $minfo['borrow_vouch_cuse']; if ($minfo['time_limit'] > 0) { $mess['time_limit'] = date('Y-m-d', $minfo['time_limit']); } else { $mess['time_limit'] = "0"; } if ($minfo['credit_cuse'] == null) { $mess['credit_cuse'] = 0; } if ($minfo['borrow_vouch_cuse'] == null) { $mess['borrow_vouch_cuse'] = 0; } $user_qdd = M('escrow_account')->field("invest_auth,secondary_percent")->where("uid=" . $this->uid)->find(); if ($user_qdd['invest_auth'] == 0 || $user_qdd['secondary_percent'] == 0) { $mess['escrow_auth'] = 0; } else { $mess['escrow_auth'] = 1; } $vobank = M("member_banks")->field(true)->where("uid = {$this->uid} and bank_num !=''")->find(); if (empty($vobank['bank_num'])) { $mess['bank_status'] = 0; } else { $mess['bank_status'] = 1; } $kflist = get_admin_name(); $kflist = $kflist[$minfo['customer_id']]; if ($_kflist == null) { $mess['kflist'] = "暂未选择客服"; } $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']; } if ($rule == 0) { $mess['qq'] = '暂无QQ'; $mess['phone'] = '暂无客服电话'; } $money_info = M("member_money")->field("account_money, back_money")->where("uid={$this->uid}")->find(); $mess['common_money'] = empty($money_info['account_money']) ? '0.00' : $money_info['account_money']; $money_info = M("member_money")->field("account_money, back_money")->where("uid={$this->uid}")->find(); $mess['back_money'] = empty($money_info['back_money']) ? '0.00' : $money_info['back_money']; ajaxmsg($mess); }
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(); }
public function export() { ini_set("memory_limit", "-1"); set_time_limit(0); import("ORG.Io.Excel"); alogs("CapitalAccount", 0, 1, '执行了所有会员资金列表导出操作!'); //管理员操作日志 $map = array(); if ($_REQUEST['uname']) { $map['m.user_name'] = array("like", urldecode($_REQUEST['uname']) . "%"); $search['uname'] = urldecode($_REQUEST['uname']); } if ($_REQUEST['realname']) { $map['mi.real_name'] = urldecode($_REQUEST['realname']); $search['realname'] = $map['mi.real_name']; } /** if(!empty($_REQUEST['bj']) && !empty($_REQUEST['lx']) && !empty($_REQUEST['money'])){ if($_REQUEST['lx']=='allmoney'){ if($_REQUEST['bj']=='gt'){ $bj = '>'; }else if($_REQUEST['bj']=='lt'){ $bj = '<'; }else if($_REQUEST['bj']=='eq'){ $bj = '='; } $map['_string'] = "(mm.account_money+mm.back_money) ".$bj.$_REQUEST['money']; }else{ $map[$_REQUEST['lx']] = array($_REQUEST['bj'],$_REQUEST['money']); } $search['bj'] = $_REQUEST['bj']; $search['lx'] = $_REQUEST['lx']; $search['money'] = $_REQUEST['money']; } */ //余额 if (!empty($_REQUEST['bj1']) && !empty($_REQUEST['money'])) { if ($_REQUEST['bj1'] == 'gt') { $bj = '>'; } else { if ($_REQUEST['bj1'] == 'lt') { $bj = '<'; } else { if ($_REQUEST['bj1'] == 'eq') { $bj = '='; } } } $map['_string'] = "(mm.account_money+mm.back_money) " . $bj . $_REQUEST['money']; $search['bj1'] = $_REQUEST['bj1']; $search['money'] = $_REQUEST['money']; } //冻结金额 if (!empty($_REQUEST['bj2']) && !empty($_REQUEST['money_freeze'])) { $map['mm.money_freeze'] = array($_REQUEST['bj2'], $_REQUEST['money_freeze']); $search['bj2'] = $_REQUEST['bj2']; $search['money_freeze'] = $_REQUEST['money_freeze']; } //待收金额 if (!empty($_REQUEST['bj3']) && !empty($_REQUEST['money_collect'])) { $map['mm.money_collect'] = array($_REQUEST['bj3'], $_REQUEST['money_collect']); $search['bj3'] = $_REQUEST['bj3']; $search['money_collect'] = $_REQUEST['money_collect']; } //分页处理 import("ORG.Util.Page"); $count = M('members m')->join("{$this->pre}member_money mm ON mm.uid=m.id")->join("{$this->pre}member_info mi ON mi.uid=m.id")->where($map)->count('m.id'); $p = new Page($count, C('ADMIN_PAGE_SIZE')); $page = $p->show(); $Lsql = "{$p->firstRow},{$p->listRows}"; //分页处理 $pre = $this->pre; $field = 'm.id,m.reg_time,m.user_name,mi.real_name,mm.money_freeze,mm.money_collect,(mm.account_money+mm.back_money) total_money,mm.account_money,mm.back_money'; $list = M('members m')->field($field)->join("{$this->pre}member_money mm ON mm.uid=m.id")->join("{$this->pre}member_info mi ON mi.uid=m.id")->where($map)->order("m.id DESC")->select(); foreach ($list as $key => $v) { $uid = $v['id']; //$umoney = M('members')->field('account_money,reward_money')->find($uid); //待确认投标 $investing = M()->query("select sum(investor_capital) as capital from {$pre}borrow_investor where investor_uid={$uid} AND status=1"); //待收金额 $invest = M()->query("select sum(investor_capital-receive_capital) as capital,sum(reward_money) as jiangli,sum(investor_interest-receive_interest) as interest from {$pre}borrow_investor where investor_uid={$uid} AND status =4"); //$invest = M()->query("SELECT sum(capital) as capital,sum(interest) as interest FROM {$pre}investor_detail WHERE investor_uid={$uid} AND `status` =7"); //待付金额 $borrow = M()->query("select sum(borrow_money-repayment_money) as repayment_money,sum(borrow_interest-repayment_interest) as repayment_interest from {$pre}borrow_info where borrow_uid={$uid} AND borrow_status=6"); $withdraw0 = M('member_withdraw')->where("uid={$uid} AND withdraw_status=0")->sum('withdraw_money'); //待提现 $withdraw1 = M('member_withdraw')->where("uid={$uid} AND withdraw_status=1")->sum('withdraw_money'); //提现处理中 $withdraw2 = M('member_withdraw')->where("uid={$uid} AND withdraw_status=2")->sum('withdraw_money'); //已提现 $withdraw3 = M('member_withdraw')->where("uid={$uid} AND withdraw_status=0")->sum('second_fee'); //待提现手续费 $withdraw4 = M('member_withdraw')->where("uid={$uid} AND withdraw_status=1")->sum('second_fee'); //处理中提现手续费 $borrowANDpaid = M()->query("select status,sort_order,borrow_id,sum(capital) as capital,sum(interest) as interest from {$pre}investor_detail where borrow_uid={$uid} AND status in(1,2,3)"); $investEarn = M('borrow_investor')->where("investor_uid={$uid} and status in(4,5,6)")->sum('receive_interest'); $investPay = M('borrow_investor')->where("investor_uid={$uid} status<>2")->sum('investor_capital'); $investEarn1 = M('borrow_investor')->where("investor_uid={$uid} and status in(4,5,6)")->sum('invest_fee'); //投资者管理费 $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(2,4)")->sum('borrow_fee'); $uplevefee = M('member_moneylog')->where("uid={$uid} AND type=2")->sum('affect_money'); //$adminop = M('member_moneylog')->where("uid={$uid} AND type=7")->sum('affect_money'); $txfee = M('member_withdraw')->where("uid={$uid} AND withdraw_status=2")->sum('second_fee'); $czfee = M('member_payonline')->where("uid={$uid} AND status=1")->sum('fee'); $interest_needpay = M()->query("select sum(borrow_interest-repayment_interest) as need_interest from {$pre}borrow_info where borrow_uid={$uid} AND borrow_status=6"); $interest_willget = M()->query("select sum(investor_interest-receive_interest) as willget_interest from {$pre}borrow_investor where investor_uid={$uid} AND status=4"); //$interest_jiliang =M('borrow_investor')->where("borrow_uid={$uid}")->sum('reward_money');//累计支付投标奖励 $moneylog = M("member_moneylog")->field("type,sum(affect_money) as money")->where("uid={$uid}")->group("type")->select(); $listarray = array(); foreach ($moneylog as $vs) { $listarray[$vs['type']]['money'] = $vs['money'] > 0 ? $vs['money'] : $vs['money'] * -1; } //$money['kyxjje'] = $umoney['account_money'];//可用现金金额 $money['kyxjje'] = $v['account_money']; //可用现金金额 $money['dsbx'] = floatval($invest[0]['capital'] + $invest[0]['interest']); //待收本息 $money['dsbj'] = $invest[0]['capital']; //待收本金 $money['dslx'] = $invest[0]['interest']; //待收利息 $money['dfbx'] = floatval($borrow[0]['repayment_money'] + $borrow[0]['repayment_interest']); //待付本息 $money['dfbj'] = $borrow[0]['repayment_money']; //待付本金 $money['dflx'] = $borrow[0]['repayment_interest']; //待付利息 $money['dxrtb'] = $investing[0]['capital']; //待确认投标 $money['dshtx'] = $withdraw0 + $withdraw3; //待审核提现 $money['clztx'] = $withdraw1 + $withdraw4; //处理中提现 //$money['jzlx'] = $investEarn;//净赚利息 //$money['jzlx'] = $investEarn-$investEarn1;//净赚利息 $temp_arr = get_personal_benefit($uid); $money['jzlx'] = $temp_arr['interest']; $money['jflx'] = $borrowANDpaid[0]['interest']; //净付利息 $money['ljjj'] = 0.0; //$umoney['reward_money'];//累计收到奖金 $money['ljhyf'] = $uplevefee; //累计支付会员费 $money['ljtxsxf'] = $txfee; //累计提现手续费 $money['ljczsxf'] = $czfee; //累计充值手续费 $money['total_2'] = $money['jzlx'] - $money['jflx'] - $money['ljhyf'] - $money['ljtxsxf'] - $money['ljczsxf']; $money['ljtzje'] = $investPay; //累计投资金额 $money['ljjrje'] = $borrowANDpaid[0]['borrow_money']; //累计借入金额 $money['ljczje'] = $payonline; //累计充值金额 $money['ljtxje'] = $withdraw2; //累计提现金额 $money['ljzfyj'] = $commission1 + $commission2; //累计支付佣金 $money['glycz'] = $listarray['17']['money']; //管理员操作资金 // $money['dslxze'] = $interest_willget[0]['willget_interest']; //待收利息总额 $money['dflxze'] = $interest_needpay[0]['need_interest']; //待付利息总额 $money['ljtbjl'] = $listarray['20']['money']; //累计投标奖励 $list[$key]['xmoney'] = $money; } $row = array(); $row[0] = array('ID', '用户名', '真实姓名', '总余额', '可用余额', '冻结金额', '待收本息金额', '待收本金金额', '待收利息金额', '待付本息金额', '待付本金金额', '待付利息金额', '待确认投标', '待审核提现+手续费', '处理中提现+手续费', '累计提现手续费', '累计充值手续费', '累计提现金额', '累计充值金额', '累计支付佣金', '累计投标奖励', '净赚利息', '净付利息', '管理员操作资金'); $i = 1; foreach ($list as $v) { $row[$i]['uid'] = $v['id']; $row[$i]['card_num'] = $v['user_name']; $row[$i]['card_pass'] = $v['real_name']; $row[$i]['card_mianfei'] = $v['money_freeze'] + $v['total_money'] + $v['money_collect']; $row[$i]['card_mianfei1'] = $v['total_money']; $row[$i]['card_mianfei2'] = $v['money_freeze']; $row[$i]['dsbx'] = $v['xmoney']['dsbx']; $row[$i]['dsbj'] = $v['xmoney']['dsbj']; $row[$i]['dslx'] = $v['xmoney']['dslx']; $row[$i]['dfbx'] = $v['xmoney']['dfbx']; $row[$i]['dfbj'] = $v['xmoney']['dfbj']; $row[$i]['dflx'] = $v['xmoney']['dflx']; $row[$i]['dxrtb'] = $v['xmoney']['dxrtb']; $row[$i]['dshtx'] = $v['xmoney']['dshtx']; $row[$i]['clztx'] = $v['xmoney']['clztx']; $row[$i]['ljtxsxf'] = $v['xmoney']['ljtxsxf']; $row[$i]['ljczsxf'] = $v['xmoney']['ljczsxf']; $row[$i]['ljtxje'] = $v['xmoney']['ljtxje']; $row[$i]['ljczje'] = $v['xmoney']['ljczje']; $row[$i]['ljzfyj'] = $v['xmoney']['ljzfyj']; $row[$i]['ljtbjl'] = $v['xmoney']['ljtbjl']; $row[$i]['jzlx'] = $v['xmoney']['jzlx']; $row[$i]['jflx'] = $v['xmoney']['jflx']; $row[$i]['glycz'] = $v['xmoney']['glycz']; $i++; } $xls = new Excel_XML('UTF-8', false, 'datalist'); $xls->addArray($row); $xls->generateXML("membersInfo"); }
public function summary() { $jsoncode = file_get_contents("php://input"); $arr = array(); $arr = json_decode($jsoncode, true); //alogsm("changepwd",0,1,$jsoncode); if (intval($arr['uid']) != $this->uid) { ajaxmsg("用户错误!", 0); } $vlist = getMemberMoneySummary($this->uid); $minfo = getMinfo($this->uid, true); $benefit = get_personal_benefit($this->uid); //收入 $out = get_personal_out($this->uid); //支出 $pcount = get_personal_count($this->uid); //可用现金金额: $canuse = $minfo['account_money'] + $minfo['back_money']; $data['canuse'] = empty($canuse) ? '0.00' : (string) $canuse; //待收总额: $data['money_collect'] = empty($minfo['money_collect']) ? '0.00' : (string) $minfo['money_collect']; //冻结总额: $data['money_freeze'] = empty($minfo['money_freeze']) ? '0.00' : (string) $minfo['money_freeze']; //账户资金总额: $all_money = $minfo['account_money'] + $minfo['back_money'] + $minfo['money_collect'] + $minfo['money_freeze']; $data['all_money'] = empty($all_money) ? '0.00' : (string) $all_money; //净赚利息: $data['getinterest'] = empty($benefit['interest']) ? '0.00' : (string) $benefit['interest']; //净付利息: $data['outinterest'] = empty($out['interest']) ? '0.00' : (string) $out['interest']; //支付会员认证费: $data['authenticate'] = empty($out['authenticate']) ? '0.00' : (string) $out['authenticate']; //借款管理费 $data['borrow_manage'] = empty($out['borrow_manage']) ? '0.00' : (string) $out['borrow_manage']; //逾期及催收费用: $data['overdue'] = empty($out['overdue']) ? '0.00' : (string) $out['overdue']; //累计提现手续费: $data['withdraw_fee'] = empty($out['withdraw_fee']) ? '0.00' : (string) $out['withdraw_fee']; //累计投标奖励: $data['ireward'] = empty($benefit['ireward']) ? '0.00' : (string) $benefit['ireward']; //累计支付投标奖励: $data['pay_tender'] = empty($out['pay_tender']) ? '0.00' : (string) $out['pay_tender']; //累计推广奖励: $data['spread_reward'] = empty($benefit['spread_reward']) ? '0.00' : (string) $benefit['spread_reward']; //累计线下充值奖励: $data['re_reward'] = empty($benefit['re_reward']) ? '0.00' : (string) $benefit['re_reward']; //累计续投奖励: $data['con_reward'] = empty($benefit['con_reward']) ? '0.00' : (string) $benefit['con_reward']; //累计充值手续费: $data['czfee'] = empty($benefit['czfee']) ? '0.00' : (string) $benefit['czfee']; //累计盈亏总额: $iomoney = $benefit['total'] - $out['total']; $data['iomoney'] = empty($iomoney) ? '0.00' : (string) $iomoney; //累计投资金额: $data['ljtz'] = empty($pcount['ljtz']) ? '0.00' : (string) $pcount['ljtz']; //累计借入金额: $data['jrje'] = empty($pcount['jrje']) ? '0.00' : (string) $pcount['jrje']; //累计充值金额 $data['payonline'] = empty($pcount['payonline']) ? '0.00' : (string) $pcount['payonline']; //累计提现金额: $data['withdraw'] = empty($pcount['withdraw']) ? '0.00' : (string) $pcount['withdraw']; //累计支付管理费: $data['commission'] = empty($pcount['commission']) ? '0.00' : (string) $pcount['commission']; //待收利息总额: $data['interest_collection'] = empty($benefit['interest_collection']) ? '0.00' : (string) $benefit['interest_collection']; //待付利息总额: $data['interest_pay'] = empty($benefit['interest_pay']) ? '0.00' : (string) $benefit['interest_pay']; ajaxmsg($data); }
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(); }