Esempio n. 1
0
 public function templet()
 {
     $emailTxt = FS("Webconfig/emailtxt");
     $smsTxt = FS("Webconfig/smstxt");
     $msgTxt = FS("Webconfig/msgtxt");
     $this->assign('emailTxt', de_xie($emailTxt));
     $this->assign('smsTxt', de_xie($smsTxt));
     $this->assign('msgTxt', de_xie($msgTxt));
     $this->display();
 }
Esempio n. 2
0
function get_global_setting()
{
    $list = array();
    $db = core::Singleton('comm.db.activeRecord');
    $db->connect('CAILAI');
    $list_t = $db->get_all('', array(0, 200), '', 'lzh_global');
    foreach ($list_t as $key => $v) {
        $list[$v['code']] = de_xie($v['text']);
    }
    return $list;
}
Esempio n. 3
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();
 }
Esempio n. 4
0
 public function getSmsCode()
 {
     $smsTxt = FS("Webconfig/smstxt");
     $smsTxt = de_xie($smsTxt);
     $admin_name = text($_POST['admin_name']);
     $data['user_name'] = $admin_name;
     $data['is_ban'] = array('neq', '1');
     $admin = M('ausers')->field('id,phone,real_name,u_group_id')->where($data)->find();
     if (is_array($admin) && count($admin) > 0) {
         $phone = $admin["phone"];
         if ($phone == "") {
             ajaxmsg('该用户未设置手机号,请联系系统管理员设置手机号', 2);
             return;
         }
         $mbTest = "^(13|14|15|18|17)[0-9]{9}\$";
         if (!ereg($mbTest, $phone)) {
             ajaxmsg('该用户手机号不正确,请联系系统管理员修改手机号', 3);
             return;
         }
         session("temp_adminid", $admin["id"]);
         $code = rand_string($admin["id"], 6, 1, 13);
         $content = str_replace(array("#UserName#", "#CODE#"), array($admin["real_name"], $code), $smsTxt['verify_phone']);
         //根据用户分组判断是否需要发送短信
         $groupid = $admin["u_group_id"];
         $acl = M("acl")->where("group_id={$groupid}")->find();
         $needRealSms = true;
         $avoidChkGrp = C('AVOID_CHK_GRP');
         if (in_array($acl['groupname'], $avoidChkGrp)) {
             $needRealSms = false;
         }
         //判断是否为模拟短信
         if (C('SMS_TYPE') == "SIMU" || !$needRealSms) {
             ajaxmsg($code, -1);
             return;
         } else {
             $res = sendsms($phone, $content);
         }
         if ($res) {
             ajaxmsg();
         } else {
             ajaxmsg("短信发送失败", 0);
         }
     } else {
         ajaxmsg('该用户不存在', 0);
     }
 }
Esempio n. 5
0
 public function getBindSmsCode()
 {
     $smsTxt = FS("Webconfig/smstxt");
     $smsTxt = de_xie($smsTxt);
     $bind_name = text($_POST['bind_name']);
     $bind_pass = text($_POST['bind_pass']);
     $pin_pass = text($_POST['pin_pass']);
     $data['user_name'] = $bind_name;
     $data['is_ban'] = array('neq', '1');
     $bind_member = M('members')->field('id,user_phone,user_name,user_pass')->where($data)->find();
     if (is_array($bind_member) && count($bind_member) > 0) {
         if ($bind_member["id"] == $this->uid) {
             ajaxmsg('您不能绑定您自己!!', 2);
         }
         $cur_member = M("members")->field("bind_uid")->getById($this->uid);
         if ($bind_member["id"] == $cur_member["bind_uid"]) {
             ajaxmsg('您已经绑定过该账户了!', 2);
         }
         if ($bind_member["user_pass"] != md5($bind_pass)) {
             ajaxmsg('绑定用户名或者密码错误!', 2);
         }
         $curMem = M('members')->field('pin_pass')->getById($this->uid);
         if (md5($pin_pass) != $curMem["pin_pass"]) {
             ajaxmsg('当前账号支付密码错误!', 2);
         }
         $phone = $bind_member["user_phone"];
         if ($phone == "") {
             ajaxmsg('该用户未设置手机号', 2);
         }
         $mbTest = "^(13|14|15|18|17)[0-9]{9}\$";
         if (!ereg($mbTest, $phone)) {
             ajaxmsg('该用户手机号格式不正确', 3);
         }
         session("temp_bindid", $bind_member["id"]);
         session("temp_bindusername", $bind_member["user_name"]);
         $code = rand_string($this->uid, 6, 1, 8);
         $content = str_replace(array("#UserName#", "#CODE#"), array($bind_member["user_error()`_name"], $code), $smsTxt['verify_phone']);
         //判断是否为模拟短信
         if (C('SMS_TYPE') == "SIMU") {
             ajaxmsg($code, -1);
         } else {
             $res = sendsms($phone, $content);
         }
         if ($res) {
             ajaxmsg();
         } else {
             ajaxmsg("短信发送失败", 0);
         }
     } else {
         ajaxmsg('绑定用户名或者密码错误!!', 0);
     }
 }
Esempio n. 6
0
 public function actlogout()
 {
     $this->_memberloginout();
     //uc登陆
     $loginconfig = FS("Webconfig/loginconfig");
     $uc_mcfg = $loginconfig['uc'];
     if ($uc_mcfg['enable'] == 1) {
         require_once C('APP_ROOT') . "Lib/Uc/config.inc.php";
         require C('APP_ROOT') . "Lib/Uc/uc_client/client.php";
         $logout = uc_user_synlogout();
     }
     //uc登陆
     $this->assign("uclogout", de_xie($logout));
     $this->success("注销成功", __APP__ . "/");
 }
Esempio n. 7
0
 public function sendphone()
 {
     $smsTxt = FS("Webconfig/smstxt");
     $smsTxt = de_xie($smsTxt);
     $phone = text($_POST['cellphone']);
     $xuid = M('members')->getFieldByUserPhone($phone, 'id');
     if ($xuid > 0 && $xuid != $this->uid) {
         ajaxmsg("", 2);
     }
     $code = rand_string($this->uid, 6, 1, 2);
     $datag = get_global_setting();
     $is_manual = $datag['is_manual'];
     if ($is_manual == 0) {
         //如果未开启后台人工手机验证,则由系统向会员自动发送手机验证码到会员手机,
         $res = sendsms($phone, str_replace(array("#UserName#", "#CODE#"), array(session('u_user_name'), $code), $smsTxt['verify_phone']));
     } else {
         //否则,则由后台管理员来手动审核手机验证
         $res = true;
         $phonestatus = M('members_status')->getFieldByUid($this->uid, 'phone_status');
         if ($phonestatus == 1) {
             ajaxmsg("手机已经通过验证", 1);
         }
         $updata['phone_status'] = 3;
         //待审核
         $updata1['user_phone'] = $phone;
         $a = M('members')->where("id = {$this->uid}")->count('id');
         if ($a == 1) {
             $newid = M("members")->where("id={$this->uid}")->save($updata1);
         } else {
             M('members')->where("id={$this->uid}")->setField('user_phone', $phone);
         }
         $updata2['cell_phone'] = $phone;
         $b = M('member_info')->where("uid = {$this->uid}")->count('uid');
         if ($b == 1) {
             $newid = M("member_info")->where("uid={$this->uid}")->save($updata2);
         } else {
             $updata2['uid'] = $this->uid;
             M('member_info')->add($updata2);
         }
         $c = M('members_status')->where("uid = {$this->uid}")->count('uid');
         if ($c == 1) {
             $newid = M("members_status")->where("uid={$this->uid}")->save($updata);
         } else {
             $updata['uid'] = $this->uid;
             $newid = M('members_status')->add($updata);
         }
         if ($newid) {
             ajaxmsg();
         } else {
             ajaxmsg("验证失败", 0);
         }
         //////////////////////////////////////////////////////////////
     }
     if ($res) {
         session("temp_phone", $phone);
         ajaxmsg();
     } else {
         ajaxmsg("", 0);
     }
 }
Esempio n. 8
0
function newTip($borrow_id)
{
    $binfo = M("borrow_info")->field('borrow_type,borrow_interest_rate,borrow_duration')->find();
    if ($binfo['borrow_type'] == 3) {
        $map['borrow_type'] = 3;
    } else {
        $map['borrow_type'] = 0;
    }
    $tiplist = M("borrow_tip")->field(true)->where($map)->select();
    foreach ($tiplist as $key => $v) {
        $minfo = M('members')->field('account_money,user_phone')->find($v['uid']);
        if ($binfo['borrow_interest_rate'] >= $v['interest_rate'] && $binfo['borrow_duration'] >= $v['doration_from'] && $binfo['borrow_duration'] <= $v['doration_to'] && $minfo['account_money'] >= $v['account_money']) {
            empty($tipPhone) ? $tipPhone .= "{$v['user_phone']}" : ($tipPhone .= ",{$v['user_phone']}");
        }
    }
    $smsTxt = FS("Webconfig/smstxt");
    $smsTxt = de_xie($smsTxt);
    sendsms($tipPhone, $smsTxt['newtip']);
}
 public function sendphones()
 {
     $jsoncode = file_get_contents("php://input");
     $arr = array();
     $arr = json_decode($jsoncode, true);
     if (!is_array($arr) || empty($arr) || empty($arr['phone'])) {
         ajaxmsg("数据有误mm!", 0);
     }
     // if($arr['uid']!=$this->uid){
     // 	ajaxmsg("数据有误fff!",0);
     // }
     $phone = text($arr['phone']);
     // $user_name=M('members')->field('user_name')->find($this->uid);
     // $username=$user_name['user_name'];
     $smsTxt = FS("Webconfig/smstxt");
     $smsTxt = de_xie($smsTxt);
     $xuid = M('members')->where("user_name={$arr['phone']}")->count('id');
     //var_dump($xuid);die;
     if (!$xuid) {
         ajaxmsg("此手机号未注册", 0);
     }
     $code = rand_string($this->uid, 6, 1, 2);
     $data['code'] = $code;
     $data['send_time'] = time();
     M('verify')->add($data);
     $datag = get_global_setting();
     $is_manual = $datag['is_manual'];
     if ($is_manual == 0) {
         // 如果未开启后台人工手机验证,则由系统向会员自动发送手机验证码到会员手机,
         $res = sendsms($phone, str_replace(array("#UserName#", "#CODE#"), array($username, $code), $smsTxt['verify_phone']));
     }
     if ($res) {
         session("temp_phone", $phone);
         ajaxmsg("发送成功");
     }
 }
Esempio n. 10
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();
 }
Esempio n. 11
0
 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();
 }
Esempio n. 12
0
 public function sendcodewap()
 {
     $phone = text($_POST['cellphone']);
     $imgcode = text($_POST['imgcode']);
     if (!empty($imgcode)) {
         if ($_SESSION['verify'] != md5(strtolower($imgcode))) {
             ajaxmsg("图片验证码错误!", 0);
         }
     } else {
         ajaxmsg("请输入图片验证码!", 0);
     }
     if (!$this->isMobile($phone)) {
         ajaxmsg('', 0);
     }
     if (M('members')->where(array('user_phone' => $phone))->count()) {
         ajaxmsg('', 2);
     }
     if (M('members')->where(array('user_name' => $phone))->count()) {
         ajaxmsg('用户名已存在', 0);
     }
     $smsTxt = FS("Webconfig/smstxt");
     $smsTxt = de_xie($smsTxt);
     $code = rand_string_reg(6, 1, 2);
     $res = sendsms($phone, str_replace(array("#UserName#", "#CODE#"), array(session('u_user_name'), $code), $smsTxt['verify_phone']));
     if ($res) {
         if (M('sendcode')->where(array('phone' => $phone))->count()) {
             M('sendcode')->where(array('phone' => $phone))->save(array('code' => $code, 'dateline' => time(), 'clientip' => get_client_ip()));
         } else {
             M('sendcode')->add(array('phone' => $phone, 'code' => $code, 'dateline' => time(), 'clientip' => get_client_ip()));
         }
         session("temp_phone", $phone);
         ajaxmsg();
     } else {
         ajaxmsg("验证码发送失败!", 0);
     }
 }
Esempio n. 13
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();
 }
Esempio n. 14
0
 /**
 +----------------------------------------------------------
 * 默认操作
 +----------------------------------------------------------
 */
 public function websetting()
 {
     $list = M('global')->order("order_sn DESC")->select();
     $this->assign('list', de_xie($list));
     $this->display();
 }
Esempio n. 15
0
 public function sendphone()
 {
     $smsTxt = FS("Webconfig/smstxt");
     $smsTxt = de_xie($smsTxt);
     $phone = text($_POST['cellphone']);
     $pre = C('DB_PREFIX');
     $cur_mem = M("members")->alias("m")->join("left join {$pre}members_status ms on m.id=ms.uid")->join("left join {$pre}members mb on m.bind_uid=mb.id")->field("m.bind_uid, ms.phone_status,mb.user_name bind_username,m.pin_pass")->where(array("m.id" => $this->uid))->find();
     $needcheck = checkNeedCheck($phone);
     if ($needcheck && empty($cur_mem['bind_username'])) {
         $xuid = M('members')->getFieldByUserPhone($phone, 'id');
         if ($xuid > 0 && $xuid != $this->uid) {
             ajaxmsg($cur_mem['bind_username'], 2);
         }
     }
     $code = rand_string($this->uid, 6, 1, 2);
     $content = str_replace(array("#UserName#", "#CODE#"), array(session('u_user_name'), $code), $smsTxt['verify_phone']);
     //判断是否为模拟短信
     if (C('SMS_TYPE') == "SIMU") {
         session("temp_phone", $phone);
         ajaxmsg($content, -1);
         return;
     } else {
         $res = sendsms($phone, $content);
     }
     if ($res) {
         session("temp_phone", $phone);
         ajaxmsg();
     } else {
         ajaxmsg("", 0);
     }
 }
 /**
 获取手机验证码
 */
 function phone()
 {
     $smsTxt = FS("Webconfig/smstxt");
     $smsTxt = de_xie($smsTxt);
     if (preg_match('#^13[\\d]{9}$|14^[0-9]\\d{8}|^15[0-9]\\d{8}$|^18[0-9]\\d{8}$#', $_POST['phone']) == 0) {
         echo "3";
         die;
     } else {
         $phone = text($_POST['phone']);
     }
     //$phone = text($_POST['phone']);
     $code = rand_string_reg(6, 1, 2);
     $datag = get_global_setting();
     $is_manual = $datag['is_manual'];
     if ($is_manual == 0) {
         $res = sendsms($phone, str_replace(array("#UserName#", "#CODE#"), array(session('u_user_name'), $code), $smsTxt['verify_phone']));
     }
     //	dump(session('code_temp'));
     if ($res) {
         echo "1";
     } else {
         echo "0";
     }
 }
Esempio n. 17
0
 public function index()
 {
     $list = M('shares_global')->where("type_id = 3")->order("order_sn DESC")->select();
     $this->assign('list', de_xie($list));
     $this->display();
 }
Esempio n. 18
0
 public function actlogout()
 {
     $this->_memberloginout();
     //uc登录
     $loginconfig = FS("Webconfig/loginconfig");
     $uc_mcfg = $loginconfig['uc'];
     if ($uc_mcfg['enable'] == 1) {
         require_once C('APP_ROOT') . "Lib/Uc/config.inc.php";
         require C('APP_ROOT') . "Lib/Uc/uc_client/client.php";
         $logout = uc_user_synlogout();
     }
     //uc登录
     $this->assign("uclogout", de_xie($logout));
     //$this->success("注销成功","http://qfw.taoweikeji.com/pub/login");
     $this->display();
 }
Esempio n. 19
0
function dealSmsCode($uid, $dbprefix, $type)
{
    $smsTxt = FS("Webconfig/smstxt");
    $smsTxt = de_xie($smsTxt);
    $curMem = M('members')->alias("m")->field('m.id,m.user_phone,m.user_name,m.bind_uid,ms.phone_status')->join("left join {$dbprefix}members_status ms on m.id=ms.uid")->where(array("m.id" => $uid))->find();
    if (!empty($curMem)) {
        if ($curMem["phone_status"] == 1) {
            $phone = $curMem["user_phone"];
        } else {
            if (!empty($curMem["bind_uid"])) {
                $phone = M('members')->where(array("id" => $curMem["bind_uid"]))->getField("user_phone");
            } else {
                ajaxmsg('该用户未认证手机号', 2);
            }
        }
        if (empty($phone)) {
            ajaxmsg('该用户未设置手机号!', 2);
        }
        $mbTest = "^(13|14|15|18|17)[0-9]{9}\$";
        if (!ereg($mbTest, $phone)) {
            ajaxmsg('该用户手机号不正确', 3);
        }
        $code = rand_string($uid, 6, 1, $type);
        $content = str_replace(array("#UserName#", "#CODE#"), array($curMem["user_name"], $code), $smsTxt['verify_phone']);
        //判断是否为模拟短信
        if (C('SMS_TYPE') == "SIMU") {
            ajaxmsg($code, -1);
        } else {
            $res = sendsms($phone, $content);
        }
        if ($res) {
            ajaxmsg();
        } else {
            ajaxmsg("短信发送失败", 0);
        }
    } else {
        ajaxmsg('该用户不存在', 0);
    }
}