Exemplo n.º 1
0
 public function zbank()
 {
     $id = $_SESSION['u_id'];
     $pre = C("DB_PREFIX");
     $banks = array('ICBC' => '工商银行', 'ABC' => '农行', 'CMB' => '招行', 'CCB' => '建设银行', 'BCCB' => '北京银行', 'BJRCB' => '北京农村商业银行', 'BOC' => '中国银行', 'BOCOM' => '交通银行', 'CMBC' => '民生银行', 'BOS' => '上海银行', 'CBHB' => '渤海银行', 'CEB' => '光大银行', 'CIB' => '兴业银行', 'CITIC' => '中信银行', 'CZB' => '浙商银行', 'GDB' => '广发银行', 'HKBEA' => '东亚银行', 'HXB' => '华夏银行', 'HZCB' => '杭州银行', 'NJCB' => '南京银行', 'PINGAN' => '平安银行', 'PSBC' => '邮储银行', 'SDB' => '深发银行', 'SPDB' => '浦发', 'SRCB' => '上海农村商业银行');
     $mBankInfo = M("members m")->join("{$pre}member_banks b ON m.id=b.uid")->field('m.usrid,b.bank_num,b.bank_name')->where("m.id={$id}")->find();
     $merCustId = '6000060000758826';
     $usrCustId = $mBankInfo['usrid'];
     //            $cardId = $mBankInfo['bank_num'];
     import("ORG.Huifu.Huifu");
     $huifu = new Huifu();
     $k = $huifu->zwqueryCardInfo($merCustId, $usrCustId, $cardId);
     if (!empty($k['UsrCardInfolist'])) {
         foreach ($k['UsrCardInfolist'] as $zwkey => $zwvalue) {
             $zwBankInfos[$zwkey]['UsrName'] = $zwvalue['UsrName'];
             $zwbankId = $zwvalue['BankId'];
             $zwBankInfos[$zwkey]['BankId'] = $zwvalue['BankId'];
             $zwBankInfos[$zwkey]['CardKey'] = $zwvalue['CardId'];
             $zwBankInfos[$zwkey]['BankName'] = $banks[$zwbankId];
             $zwBankInfos[$zwkey]['IsDefault'] = $zwvalue['IsDefault'];
         }
     }
     $this->assign("zwBankInfo", $zwBankInfos);
     $data['html'] = $this->fetch();
     exit(json_encode($data));
 }
Exemplo n.º 2
0
 public function pay()
 {
     $info = M("members")->field("usrid")->where("id=" . $this->uid)->find();
     $usrid = $info['usrid'];
     $transamt = $_POST['money'];
     import("ORG.Huifu.Huifu");
     $huifu = new Huifu();
     $huifu->netSave($usrid, $transamt);
 }
Exemplo n.º 3
0
 public function zwbzj()
 {
     //$info = M("members")->field("usrid")->where("id=".$this->uid)->find();
     //$usrid = $info['usrid'];
     $transamt = $_POST['zw_money'];
     import("ORG.Huifu.Huifu");
     $huifu = new Huifu();
     $huifu->zwtransfer($transamt);
 }
Exemplo n.º 4
0
 public function dowithdraw()
 {
     var_dump($_POST);
     die;
     $blackPhone = M('blacklist')->field('telephone')->select();
     foreach ($blackPhone as $v) {
         $blackData[] = $v['telephone'];
     }
     if (in_array($_SESSION['u_user_name'], $blackData)) {
         echo '该账号暂时禁止提现,详情请联系财来网';
         exit;
     }
     $transamt = $_POST['money'];
     //提现金额
     $cashChl = $_POST['cashChl'];
     //提现方式zh&hgq
     $totalinvestor = M("borrow_investor")->where("investor_uid=" . $this->uid)->sum("investor_capital");
     //充值资金池的投资金额
     $borrow_cap = M("borrow_info")->where("borrow_uid=" . $this->uid)->sum("borrow_money");
     //累计借款金额
     $totalpay = M("member_paylog")->where("uid=" . $this->uid)->sum("transamt");
     //累计充值金额
     $totalwithdraw = M("member_withdrawlog")->where("uid=" . $this->uid)->sum("transamt");
     $account = M("member_money")->field("account_money,back_money")->where("uid=" . $this->uid)->find();
     $accountmoney = $account['account_money'] + $account['back_money'];
     //充值资金池可用余额+回款资金池可用余额
     if ($transamt > $accountmoney) {
         echo "余额不足,不允许提现!";
         exit;
     } else {
         if ($totalinvestor + $borrow_cap < $totalwithdraw) {
             $datag = get_global_setting();
             $fee_tqtx = $datag['fee_tqtx'];
             $feerate = explode('|', $fee_tqtx);
             $fee = $transamt * $feerate[0] / 100;
         } else {
             $datag = get_global_setting();
             $fee_tqtx = $datag['fee_tqtx'];
             $feerate = explode('|', $fee_tqtx);
             $cae = $totalinvestor + $borrow_cap - $totalwithdraw;
             if ($cae >= $transamt) {
                 $fee = $transamt * $feerate[1] / 100;
             } else {
                 $fee = ($cae * $feerate[1] + ($transamt - $cae) * $feerate[0]) / 100;
             }
         }
     }
     //echo $fee;exit;
     $info = M("members")->field("usrid")->where("id=" . $this->uid)->find();
     $usrid = intval($info['usrid']);
     import("ORG.Huifu.Huifu");
     $huifu = new Huifu();
     $huifu->cash($usrid, $transamt, $fee, $cashChl);
     //增加$cashChl参数zh&hgq
 }
Exemplo n.º 5
0
 public function unfreeze()
 {
     $borrowid = intval($_POST['bid']);
     $sort_order = intval($_POST['sort_order']);
     $borrowtrxid = M("borrow_info")->field("freezetrxid")->where("id=" . $borrowid)->find();
     $freezetrxid = $borrowtrxid['freezetrxid'];
     $type = 2;
     import("ORG.Huifu.Huifu");
     $huifu = new Huifu();
     $huifu->usrUnFreeze($freezetrxid, $borrowid, $sort_order, $type);
 }
Exemplo n.º 6
0
 public function doguar()
 {
     $usr = M("members")->field("usrid")->where("id={$this->uid}")->find();
     $usrid = $usr['usrid'];
     $receive_account = $_POST['receive_account'];
     $incust = M("members")->field("usrid")->where("user_name='" . $receive_account . "'")->find();
     $incustid = $incust['usrid'];
     $transamt = $_POST['money'];
     import("ORG.Huifu.Huifu");
     $huifu = new Huifu();
     $res = $huifu->usrTransfer($usrid, $incustid, $transamt);
 }
Exemplo n.º 7
0
 public function userinfo()
 {
     //自动对帐
     $usr = M("members")->field("usrid")->where("id=" . $this->uid)->find();
     $usrid = $usr['usrid'];
     import("ORG.Huifu.Huifu");
     $huifu = new Huifu();
     $result = $huifu->queryBalanceBg($usrid);
     if (strcmp($result['RespCode'], "000") == 0) {
         $accountval = $result['AvlBal'];
         $freezeval = $result['FrzBal'];
         $moneyinfo = M("member_money")->where("uid=" . $this->uid)->find();
         $account_money = str2val_money($accountval) - str2val_money($moneyinfo['back_money']);
         $freeze_money = str2val_money($freezeval);
         $data['money_freeze'] = $freeze_money;
         $data['account_money'] = $account_money;
         M("member_money")->where("uid=" . $this->uid)->save($data);
     } else {
         header("Content-type: text/html; charset=utf-8");
         echo $_POST['RespDesc'];
     }
     //结束
     $mess = array();
     $mess['uid'] = intval(session("u_id"));
     $vo = M('members')->field('id,user_name,user_email,user_pass,is_ban')->where("id={$mess['uid']}")->find();
     $mess['username'] = $vo['user_name'];
     $mess['phone'] = intval(session("u_user_phone"));
     $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'];
         //总额
     } else {
         $mess['total'] = 0;
         $mess['mayuse'] = 0;
         $mess['freeze'] = 0;
         $mess['collect'] = 0;
     }
     ajaxmsg($mess);
 }
Exemplo n.º 8
0
 public function newbie_repayment()
 {
     $type = 1;
     $investid = intval($_POST['invest_uid']) ? intval($_POST['invest_uid']) : 0;
     if (!$investid) {
         echo "还款失败,投资者id不存在";
     }
     $pre = C('DB_PREFIX');
     $done = false;
     $b_member = M('members')->field("user_name")->find($binfo['borrow_uid']);
     $tuoguan = FS("Webconfig/tuoguanconfig");
     $merCustId = $tuoguan['huifu']['MerCustId'];
     //还款信息 还款金额 还款利息 借款人
     $repayinfo = M("newbie_record")->field("id,invest_money,interest,borrow_uid,ordid,orddate,freezetrxid")->where('invest_uid=' . $investid)->find();
     $repaysql = M()->getLastsql();
     file_put_contents("/tmp/isnew2", date('Y-m-d') . '$repaysql-invest1125-' . print_r($repaysql, true) . "\n", FILE_APPEND);
     file_put_contents("/tmp/isnew2", date('Y-m-d') . 'REpayinfo-invest1125-' . print_r($repayinfo, true) . "\n", FILE_APPEND);
     //还款人都自己还
     $borrow_uid = $repayinfo['borrow_uid'];
     $info1 = M("members")->field("usrid")->where("id=" . $borrow_uid)->find();
     $usrid = $info1['usrid'];
     //借款人客户号
     //投资人usrid
     $info2 = M("members")->field("usrid")->where("id=" . $investid)->find();
     $investusrid = $info2['usrid'];
     //投资人客户号
     //还款汇付接口数据初始化
     $transamt = array();
     //本息
     $investor = array();
     //投资人
     $investorid = array();
     //投资人
     $Fee = array();
     //利息管理费
     $divdetails = array();
     //利息管理费详情
     $subordid = array();
     //订单号
     $suborddate = array();
     //订单日期
     $repaymentid = array();
     //还款ID
     $transamt = $repayinfo['invest_money'] + $repayinfo['interest'];
     //本息
     $investor = $investusrid;
     //投资人usrid
     $investorid = $investid;
     //投资人ID
     $Fee = 0.0;
     //利息管理费
     $divdetails = '';
     //因为利息管理费为零 所以此变量为空
     $subordid = $repayinfo['ordid'];
     //订单号
     $suborddate = $repayinfo['orddate'];
     //订单日期
     $repaymentid = $repayinfo['id'];
     //投资的记录的id
     //解除冻结保证金
     $borrowid = 1;
     //标的id为1 固定值
     $freezetrxid = $repayinfo['freezetrxid'];
     import("ORG.Huifu.Huifu");
     $huifu = new Huifu();
     // $huifu->newbie_usrUnFreeze($freezetrxid,$borrowid,$borrow_uid,$type);//解冻资金
     $cron = $huifu->repayment($usrid, $transamt, $Fee, $investor, $divdetails, $subordid, $suborddate, $borrowid, $sort_order = '', $repaymentid, $investorid, $type);
     //还款
     if ($investid) {
         echo "{$investid}还款成功";
     }
 }
Exemplo n.º 9
0
 /**
  * 确认购买
  * 流程: 检测购买条件
  * 购买
  */
 public function buy()
 {
     //$paypass = strval($_REQUEST['paypass']);
     $invest_id = intval($_REQUEST['invest_id']);
     //echo $invest_id;exit;
     D("DebtBehavior");
     $Debt = new DebtBehavior($this->uid);
     // 检测是否可以购买  密码是否正确,余额是否充足
     //$result = $Debt->buy($paypass, $invest_id);
     $debt_info = M('invest_detb')->field("transfer_price,sell_uid,debt_fee,money")->where("invest_id={$invest_id}")->find();
     $info = M("borrow_investor")->field("borrow_id,investor_uid,borrow_uid,investor_capital,investor_interest,ordid,orddate")->where("id=" . $invest_id)->find();
     $info1 = M("members")->field("usrid")->where("id=" . $debt_info['sell_uid'])->find();
     $info2 = M("members")->field("usrid")->where("id={$this->uid}")->find();
     $info3 = M("members")->field("usrid")->where("id=" . $info['borrow_uid'])->find();
     $sellcustid = $info1['usrid'];
     //转让人
     $creditamt = $info['investor_capital'];
     //转让金额(必须是本金)
     $dealamt = $debt_info['transfer_price'];
     //承接金额(转让金额上下浮动10%)
     $Fee = $debt_info['debt_fee'];
     $biddetails = array();
     $biddetails['BidOrdId'] = $info['ordid'];
     //原投标订单号
     $biddetails['BidOrdDate'] = $info['orddate'];
     //原投标订单日期
     $biddetails['BidCreditAmt'] = $info['investor_capital'];
     //从原投标订单中转出的本金
     $details = array();
     $details['BorrowerCustId'] = $info3['usrid'];
     //借款人
     $details['BorrowerCreditAmt'] = $info['investor_capital'];
     //
     $details['PrinAmt'] = "0.00";
     //已还本金
     $biddetails['BorrowerDetails'] = $details;
     $biddetails = json_encode($biddetails);
     $str1 = array('{', '}');
     $str2 = array('[{', '}]');
     $biddetails = str_replace($str1, $str2, $biddetails);
     $biddetails = '{"BidDetails":' . $biddetails . '}';
     $info2 = M("members")->field("usrid")->where("id={$this->uid}")->find();
     $buycustid = $info2['usrid'];
     //承接人
     import("ORG.Huifu.Huifu");
     $huifu = new Huifu();
     $huifu->creditAssign($sellcustid, $creditamt, $dealamt, $biddetails, $Fee, $buycustid, $invest_id);
     exit;
     //$result = $Debt->buy($invest_id);
     if ($result === 'TRUE') {
         ajaxmsg('购买成功');
     } else {
         ajaxmsg($result, 1);
     }
 }
Exemplo n.º 10
0
 public function autorepayment()
 {
     $token = $_GET['key'];
     $config = file_get_contents($this->updir . 'config.txt');
     list($startime, $condition, $key) = explode('|', $config, 3);
     if ($key != $token) {
         exit('服务器拒绝响应');
     }
     $glodata = get_global_setting();
     $pre = C("DB_PREFIX");
     $strOut = "<br/>-----------正在执行企业直投自动还款程序:服务器当前时间" . date("Y-m-d H:i:s", time()) . "---------------<br/>";
     $transfer_investor_detail = M('transfer_investor_detail');
     $map = array();
     //$map['deadline'] = array("lt",time()+86400);
     $map['status'] = 7;
     $field = 'id,invest_id,interest,investor_uid,borrow_uid,borrow_id,capital,interest_fee,sort_order';
     $lists = $transfer_investor_detail->field($field)->where($map)->select();
     //$this->pre($lists);
     if (empty($lists)) {
         return -1;
     }
     import("ORG.Huifu.Huifu");
     $Huifu = new Huifu();
     $Updateb = M('transfer_investor_detail');
     $transfer_investor_detail->startTrans();
     foreach ($lists as $rows) {
         $usrid = M('members')->getFieldById($rows['borrow_uid'], 'Usrid');
         $respose = $Huifu->queryBalanceBg($usrid);
         $acctBal = str2val_money($respose['AcctBal']);
         $this->pre($acctBal);
         $accountMoney_borrower = M('member_money')->field('money_freeze,money_collect,account_money,back_money')->find($v['borrow_uid']);
         if ($accountMoney_borrower['account_money'] + $accountMoney_borrower['back_money'] < $v['capital'] + $v['interest']) {
             return "帐户可用余额不足,本期还款共需" . ($v['capital'] + $v['interest']) . "元,请先充值!";
         }
         //借款者减少
         $datamoney_x['uid'] = $v['borrow_uid'];
         $datamoney_x['type'] = 11;
         $datamoney_x['affect_money'] = -($v['capital'] + $v['interest']);
         if ($datamoney_x['affect_money'] + $accountMoney_borrower['back_money'] < 0) {
             //如果需要还款的金额大于回款资金池资金总额
             $datamoney_x['account_money'] = floatval($accountMoney_borrower['account_money'] + $accountMoney_borrower['back_money'] + $datamoney_x['affect_money']);
             $datamoney_x['back_money'] = 0;
         } else {
             $datamoney_x['account_money'] = $accountMoney_borrower['account_money'];
             $datamoney_x['back_money'] = floatval($accountMoney_borrower['back_money']) + $datamoney_x['affect_money'];
             //回款资金注入回款资金池
         }
         $datamoney_x['collect_money'] = $accountMoney_borrower['money_collect'];
         $datamoney_x['freeze_money'] = $accountMoney_borrower['money_freeze'];
         //会员帐户
         $mmoney_x['money_freeze'] = $datamoney_x['freeze_money'];
         $mmoney_x['money_collect'] = $datamoney_x['collect_money'];
         $mmoney_x['account_money'] = $datamoney_x['account_money'];
         $mmoney_x['back_money'] = $datamoney_x['back_money'];
         //会员帐户
         $datamoney_x['info'] = "对{$v['borrow_id']}号企业直投进行还款";
         $datamoney_x['add_time'] = time();
         $datamoney_x['add_ip'] = get_client_ip();
         $datamoney_x['target_uid'] = 0;
         $datamoney_x['target_uname'] = '@网站管理员@';
         $moneynewid_x = M('member_moneylog')->add($datamoney_x);
         if ($moneynewid_x) {
             $bxid = M('member_money')->where("uid={$datamoney_x['uid']}")->save($mmoney_x);
         }
         //借款者减少
         $vo = M("transfer_borrow_investor")->field("transfer_month,transfer_num")->where("id={$v['invest_id']}")->find();
         $update_investor = array();
         $update_investor['id'] = $v['invest_id'];
         $update_investor['status'] = 2;
         //还款完成
         $update_investor['receive_capital'] = array("exp", "`receive_capital`+{$v['capital']}");
         $update_investor['receive_interest'] = array("exp", "`receive_interest`+{$v['interest']}-{$v['interest_fee']}");
         $update_investor['back_time'] = time();
         $investor = M("transfer_borrow_investor")->save($update_investor);
         $update_borrow = array();
         $update_borrow['id'] = $v['borrow_id'];
         $update_borrow['transfer_back'] = array("exp", "`transfer_back`+{$vo['transfer_num']}");
         $update_borrow['borrow_status'] = 7;
         //还款完成
         $summary = M("transfer_borrow_info")->save($update_borrow);
         $mapdetail['id'] = $v['id'];
         $updetail['status'] = 1;
         //还款完成
         $updetail['receive_capital'] = array("exp", "`receive_capital`+{$v['capital']}");
         $updetail['receive_interest'] = array("exp", "`receive_interest`+{$v['interest']}-{$v['interest_fee']}");
         $updetail['repayment_time'] = time();
         $detail = M("transfer_investor_detail")->where($mapdetail)->save($updetail);
         //$strOut .= "成功还款第{$v['borrow_id']}号企业直投<br/>";
         ////////////////////////////////////////////////////对投资帐户进行增加  开始//////////////////////////////////////////////////
         if ($investor && $summary && $detail) {
             $accountMoney = M('member_money')->field('money_freeze,money_collect,account_money,back_money')->find($v['investor_uid']);
             $datamoney['uid'] = $v['investor_uid'];
             $datamoney['type'] = "44";
             $datamoney['affect_money'] = $v['capital'] + $v['interest'] - $v['interest_fee'];
             //收利息加本金,并且扣管理费
             $datamoney['account_money'] = $accountMoney['account_money'];
             $datamoney['back_money'] = $accountMoney['back_money'] + $datamoney['affect_money'];
             $datamoney['collect_money'] = $accountMoney['money_collect'] - $datamoney['affect_money'];
             $datamoney['freeze_money'] = $accountMoney['money_freeze'];
             //会员帐户
             $mmoney['money_freeze'] = $datamoney['freeze_money'];
             $mmoney['money_collect'] = $datamoney['collect_money'];
             $mmoney['account_money'] = $datamoney['account_money'];
             $mmoney['back_money'] = $datamoney['back_money'];
             //会员帐户
             $datamoney['info'] = "收到借款人对{$v['borrow_id']}号企业直投的还款";
             $datamoney['add_time'] = time();
             $datamoney['add_ip'] = get_client_ip();
             $datamoney['target_uid'] = $binfo['borrow_uid'];
             $datamoney['target_uname'] = $b_member['user_name'];
             $moneynewid = M('member_moneylog')->add($datamoney);
             if ($moneynewid) {
                 $xid = M('member_money')->where("uid={$datamoney['uid']}")->save($mmoney);
             }
         }
         ////////////////////////////////////////////////////对投资帐户进行增加 结束//////////////////////////////////////////////////
     }
     if ($investor && $summary && $detail && $moneynewid && $xid) {
         $Updateb->commit();
         $strOut .= "成功还款第{$v['borrow_id']}号企业直投<br/>";
     } else {
         $strOut .= "第{$v['borrow_id']}号企业直投还款失败<br/>";
         $Updateb->rollback();
     }
     $data = $strOut . "\r\n" . date("Y-m-d H:i:s", time());
     //服务器时间
     echo $data;
 }
Exemplo n.º 11
0
 public function userunfreeze()
 {
     //$trxid='201510210002528553';
     $trxid = $_POST['unfreezeno'];
     $bi = M('borrow_investor');
     $bires = $bi->getFieldByFreezetrxid($trxid, 'borrow_id,investor_uid');
     //echo M()->getLastSql();
     //dei;
     $borrowid = $bires['borrow_id'];
     //$investoruid=$bires['investor_uid'];
     //	$borrowid=1039;
     import("ORG.Huifu.Huifu");
     $huifu = new Huifu();
     $hfres = $huifu->usrUnFreeze($trxid, $borrowid, $sort_order, $type);
     echo "解冻成功";
     //dump($hfres);
 }
Exemplo n.º 12
0
function autoInvest($borrow_id)
{
    $binfo = M("borrow_info")->field('borrow_uid,borrow_money,borrow_type,repayment_type,borrow_interest_rate,borrow_duration,has_vouch,has_borrow,borrow_max,borrow_min,can_auto')->find($borrow_id);
    if ($binfo['can_auto'] == '0') {
        exit;
    }
    $map['a.is_use'] = 1;
    $map['borrow_type'] = 1;
    if ($map['a.end_time'] > 0) {
        $map['a.end_time'] = array("gt", time());
    }
    $autolist = M("auto_borrow a")->join(C('DB_PREFIX') . "member_money m ON a.uid=m.uid")->join(C('DB_PREFIX') . "members ms ON a.uid=ms.id")->field("a.*,ms.usrid, m.account_money+m.back_money as money")->where($map)->order("a.invest_time asc")->select();
    $needMoney = $binfo['borrow_money'] - $binfo['has_borrow'];
    $pre = C('DB_PREFIX');
    $info2 = M("members m")->field("m.usrid")->join("{$pre}borrow_info s ON s.borrow_uid=m.id")->where("s.id = " . $borrow_id)->find();
    $borrowerid = $info2['usrid'];
    $borrowid = $borrow_id;
    $usrid = array();
    $transamt = array();
    foreach ($autolist as $key => $v) {
        if (!$needMoney) {
            break;
        }
        if ($v['uid'] == $binfo['borrow_uid']) {
            continue;
        }
        $num_max1 = intval($v['money'] - $v['account_money']);
        //账户余额-设置的最少剩余金额,即可用的投资金额数
        $num_max4 = $binfo['borrow_money'] / 10;
        //不能超过10%
        //大于最大投标且设置最大投标
        if ($investMoney > $binfo['borrow_max'] && $binfo['borrow_max'] > 0) {
            $investMoney = $binfo['borrow_max'];
        }
        if ($num_max1 > $v['invest_money']) {
            //如果可用的投资金额大于最大投资金额,则投资金额等于最大投资金额
            $investMoney = $v['invest_money'];
        } else {
            $investMoney = $num_max1;
            //如果未设置投标后账户余额,则会投出全部余额
        }
        if ($investMoney > $needMoney) {
            $investMoney = $needMoney;
        } else {
            if ($binfo['borrow_min']) {
                //设置了最小投标    如果直接满标则不考虑最小投标
                if ($investMoney < $binfo['borrow_min']) {
                    // 小于最低投标
                    continue;
                    //不符合最低投资金额
                } elseif ($needMoney - $investMoney > 0 && $needMoney - $investMoney < $binfo['borrow_min']) {
                    // 剩余金额小于最小投标金额
                    if ($investMoney - $binfo['borrow_min'] >= $binfo['borrow_min']) {
                        // 投资金额- 最小投资金额 大于最小投资金额
                        $investMoney = $investMoney - $binfo['borrow_min'];
                        // 投资 = 投资-最小投资(保证下次投资金额大于最小投资金额)
                    } else {
                        continue;
                    }
                }
            }
        }
        //投资金额不能大于借款金额的10%
        if ($investMoney > $num_max4) {
            $investMoney = $num_max4;
        }
        if ($investMoney % $binfo['borrow_min'] != 0) {
            continue;
        }
        $tiaojian = "{$needMoney} > 0";
        //可投金额大于0
        if ($v['interest_rate'] > 0) {
            $tiaojian .= " && " . $binfo['borrow_interest_rate'] . " >= " . $v['interest_rate'];
            //利率范围
        }
        if ($v['duration_from'] > 0 && $v['duration_to'] > 0 && $v['duration_from'] <= $v['duration_to']) {
            $tiaojian .= " && (" . $binfo['borrow_duration'] . " >= " . $v['duration_from'] . " || " . $v['duration_from'] . "==0) && (" . $binfo['borrow_duration'] . " <= " . $v['duration_to'] . " || " . $v['duration_to'] . "==0)";
            //借款期限范围
        }
        $tiaojian .= " && " . $investMoney . " >= " . $v['min_invest'];
        $tiaojian .= " && (" . $v['money'] . " - " . $v['account_money'] . ") >= " . $investMoney;
        //余额限制
        if ($tiaojian) {
            $usrid[] = $v['usrid'];
            $transamt[] = $investMoney;
            $needMoney = $needMoney - $investMoney;
            // 减去剩余已投金额
            MTip('chk27', $v['uid'], $borrow_id, $v['id']);
            //sss
            M('auto_borrow')->where('id = ' . $v['id'])->save(array("invest_time" => time()));
        }
    }
    /////////////////////////////////////////////////////汇付托管 2014-10-09///////////////////////////////////////////////////////////////
    import("ORG.Huifu.Huifu");
    $huifu = new Huifu();
    $huifu->autoTender_multi($usrid, $transamt, $borrowerid, $borrowid);
    /////////////////////////////////////////////////////汇付托管 END///////////////////////////////////////////////////////////////
    return true;
}
Exemplo n.º 13
0
 public function autoAwardCorn()
 {
     import("ORG.Huifu.Huifu");
     $huifu = new Huifu();
     $MemberAward = M("member_award")->where("flag='0'")->select();
     foreach ($MemberAward as $val) {
         $members = M("members")->field("usrid")->where(array("id" => $val['recommend_id']))->find();
         $huifu->transfer($val['award_money'], $members['usrid'], $val['ordid']);
         sleep(2);
     }
 }
Exemplo n.º 14
0
 public function docorpquery()
 {
     $busicode = $_POST['busicode'];
     import("ORG.Huifu.Huifu");
     $huifu = new Huifu();
     $res = $huifu->corpRegisterQuery($busicode);
     $msg = $res['AuditStat'];
     $stat = array('I' => "初始", 'T' => "提交", 'P' => "审核中", 'R' => "审核拒绝", 'F' => "开户失败", 'K' => "开户中", 'Y' => "开户成功");
     echo $stat[$msg];
 }
Exemplo n.º 15
0
Arquivo: von.php Projeto: GStepOne/CI
            $pathe = implode("/", $f);
            $re = F($fx[$num - 1], '', $pathe . "/");
        } else {
            isset($f[1]) ? $re = F($f[1], '', C("WEB_ROOT") . $f[0] . "/") : ($re = F($f[0]));
        }
        return $re;
    } else {
        if (!empty($path)) {
            $re = F($filename, $data, $path);
        } else {
            $re = F($filename, $data);
        }
    }
}
import("ORG.Huifu.Huifu");
$huifu = new Huifu();
$mysqllink = mysql_connect('115.29.245.207', 'test', 'cailai1234567890');
mysql_select_db('cailainew', $mysqllink);
$sql = "SELECT m.usrid as usrid,m.id as id,m.user_name as telephone,mm.money_freeze as money_freeze,mm.account_money as account_money,mm.back_money as back_money\n       FROM lzh_members m LEFT JOIN lzh_member_money mm ON mm.uid=m.id WHERE usrid !=''";
$data = mysql_query($sql, $mysqllink);
while ($row[] = mysql_fetch_array($data)) {
}
$data = $row;
//整合数据一部分是数据库,一部分是web端应用
$select = "SELECT real_name FROM lzh_member_info WHERE ";
// $where="1=2";
$sql = '';
$Money_data = array();
$lenght = count($data);
for ($i = 0; $i < $lenght; $i++) {
    $id = $data[$i]['id'];
Exemplo n.º 16
0
 public function tuoguanlogin()
 {
     $usr = M("members")->field("usrid")->where("id=" . $this->uid)->find();
     $usrid = $usr['usrid'];
     //用户客户号
     import("ORG.Huifu.Huifu");
     $huifu = new Huifu();
     $huifu->userLogin($usrid);
 }
Exemplo n.º 17
0
 public function investmoney()
 {
     //if(!$this->uid) exit;
     if (!$this->uid) {
         ajaxmsg('请先登录', 3);
         exit;
     }
     $type = member_type($this->uid);
     if ($type['status'] != 3) {
         ajaxmsg("您是" . $type['type'] . "用户不能投标", 3);
     }
     $money = intval($_POST['money']);
     $borrow_id = intval($_POST['borrow_id']);
     $m = M("member_money")->field('account_money,back_money,money_collect')->find($this->uid);
     $amoney = $m['account_money'] + $m['back_money'];
     $uname = session('u_user_name');
     if ($amoney < $money) {
         $this->error("尊敬的{$uname},您准备投标{$money}元,但您的账户可用余额为{$amoney}元,请先去充值再投标.", __APP__ . "/member/charge#fragment-1");
     }
     $vm = getMinfo($this->uid, 'm.pin_pass,mm.account_money,mm.back_money,mm.money_collect');
     $pin_pass = $vm['pin_pass'];
     $pin = md5($_POST['pin']);
     //if($pin<>$pin_pass) $this->error("支付密码错误,请重试");
     $binfo = M("borrow_info")->field('borrow_money,borrow_max,has_borrow,has_vouch,borrow_type,borrow_min,money_collect')->find($borrow_id);
     ////////////////////////////////////待收金额限制 2013-08-26  fan///////////////////
     if ($binfo['money_collect'] > 0) {
         if ($m['money_collect'] < $binfo['money_collect']) {
             ajaxmsg("此标设置有投标待收金额限制,您账户里必须有足够的待收才能投此标", 3);
         }
     }
     ////////////////////////////////////待收金额限制 2013-08-26  fan///////////////////
     //投标总数检测
     $capital = M('borrow_investor')->where("borrow_id={$borrow_id} AND investor_uid={$this->uid}")->sum('investor_capital');
     if ($capital + $money > $binfo['borrow_max'] && $binfo['borrow_max'] > 0) {
         $xtee = $binfo['borrow_max'] - $capital;
         $this->error("您已投标{$capital}元,此投上限为{$binfo['borrow_max']}元,你最多只能再投{$xtee}", 3);
     }
     //if($binfo['has_vouch']<$binfo['borrow_money'] && $binfo['borrow_type'] == 2) $this->error("此标担保还未完成,您可以担保此标或者等担保完成再投标");
     $need = $binfo['borrow_money'] - $binfo['has_borrow'];
     $caninvest = $need - $binfo['borrow_min'];
     if ($money > $caninvest && $need == 0) {
         $msg = "尊敬的{$uname},此标已被抢投满了,下次投标手可一定要快呦!";
         $this->error($msg);
     }
     if ($binfo['borrow_min'] - $money > 0) {
         $this->error("尊敬的{$uname},本标最低投标金额为{$binfo['borrow_min']}元,请重新输入投标金额", 3);
     }
     if ($need - $money < 0) {
         $this->error("尊敬的{$uname},此标还差{$need}元满标,您最多只能再投{$need}元", 3);
     } else {
         /////////////////////////////////////////////////////汇付托管 2014-10-09///////////////////////////////////////////////////////////////
         $pre = C('DB_PREFIX');
         $info1 = M("members")->field("usrid")->where("id=" . $this->uid)->find();
         $info2 = M("members m")->field("m.usrid")->join("{$pre}borrow_info s ON s.borrow_uid=m.id")->where("s.id = {$borrow_id}")->find();
         $usrid = $info1['usrid'];
         $borrowerid = $info2['usrid'];
         $transamt = $money;
         $type = "S";
         //表示散标
         $borrowid = $borrow_id;
         import("ORG.Huifu.Huifu");
         $huifu = new Huifu();
         $huifu->initiativeTender($usrid, $transamt, $borrowerid, $borrowid);
         /////////////////////////////////////////////////////汇付托管 END///////////////////////////////////////////////////////////////
         //$done = investMoney($this->uid,$borrow_id,$money);
     }
     /*if($done===true) {
     			$this->success("恭喜成功投标{$money}元");
     		}else if($done){
     			$this->error($done);
     		}else{
     			$this->error("对不起,投标失败,请重试!");
     		}*/
 }
Exemplo n.º 18
0
 public function duizhang()
 {
     $usrid = "6000060000699141";
     import("ORG.Huifu.Huifu");
     $huifu = new Huifu();
     $res = $huifu->queryBalanceBg($usrid);
     echo "<pre>";
     print_r($res);
     echo "</pre>";
 }
Exemplo n.º 19
0
 public function loansreturn()
 {
     file_put_contents('/tmp/debugwhh', date('m-d H:i:s') . "\$_POST:" . print_r($_POST, true) . "\n", FILE_APPEND);
     if (strcmp($_POST['RespCode'], "000") == 0) {
         $mem = new Memcache();
         $mem->connect("127.0.0.1", 11211);
         $key = 'loansreturn-' . $_POST['CmdId'] . '-' . $_POST['OutCustId'];
         $has = $mem->get($key);
         if ($has) {
             sleep(1);
             //return ;
         } else {
             //设置4秒
             $mem->set($key, 1, 0, 1);
         }
         unset($mem, $has, $key);
     }
     $usrid = $_POST['OutCustId'];
     $info = M("huifulog")->distinct(true)->field("uid,username")->where("usrid=" . $usrid)->find();
     $data = array();
     $data['uid'] = $info['uid'];
     //用户UID
     $data['username'] = $info['username'];
     //用户名
     $data['rescode'] = $_POST['RespCode'];
     //返回码
     $data['cmdid'] = $_POST['CmdId'];
     //消息类型
     $data['usrid'] = $_POST['OutCustId'];
     //用户客户号(出账人客户号)
     $data['ordid'] = $_POST['OrdId'];
     //订单号
     $data['orddate'] = $_POST['OrdDate'];
     //订单日期
     $data['trxid'] = "";
     $data['merpriv'] = $_POST['MerPriv'];
     $data['addtime'] = time();
     //记录时间
     //解冻金额是否减掉
     $reqext = 0;
     $reqext = $_POST['RespExt'];
     //代金券的内容json字符串
     $reqext = json_decode(urldecode($reqext), 1);
     $reqext = $reqext['LoansVocherAmt'];
     file_put_contents('/tmp/debugwhh', date('m-d H:i:s') . "reqext:" . print_r($reqext, true) . "\n", FILE_APPEND);
     $condition['uid'] = $data['uid'];
     $condition['ordid'] = $data['ordid'];
     $num = M("huifulog")->where($condition)->count();
     $md = M()->getLastSql();
     file_put_contents('/tmp/debugwhh', date('m-d H:i:s') . "\\md:" . print_r($md, true) . "\n", FILE_APPEND);
     if ($num == 0) {
         M("huifulog")->add($data);
         if (strcmp($_POST['RespCode'], "000") == 0) {
             $temp = base64_decode($data['merpriv']);
             $pos1 = strpos($temp, '{');
             $pos2 = strpos($temp, '}');
             $len = $pos2 - $pos1 + 1;
             $merpriv = substr($temp, $pos1, $len);
             $merpriv = json_decode($merpriv, true);
             $borrowid = $merpriv['borrowid'];
             //标ID
             $investid = $merpriv['investid'];
             //投资ID
             $binfo = M("borrow_info")->field("borrow_type,reward_type,reward_num,borrow_fee,borrow_money,borrow_uid,borrow_duration,repayment_type,manage_rate")->find($borrowid);
             //还款时间
             $endTime = strtotime(date("Y-m-d", time()) . " 23:59:59");
             //逾期时刻
             if ($binfo['borrow_type'] == 3 || $binfo['repayment_type'] == 1) {
                 $deadline = strtotime("+{$binfo['borrow_duration']} day", $endTime);
                 //天标或秒标
             } else {
                 $deadline = strtotime("+{$binfo['borrow_duration']} month", $endTime);
                 //月标
             }
             //更新投资信息
             $investinfo = array();
             $investinfo['deadline'] = $deadline;
             $investinfo['status'] = 4;
             //复审通过,还款中
             M("borrow_investor")->where("id=" . $investid)->save($investinfo);
             //更新还款信息
             switch ($binfo['repayment_type']) {
                 case 2:
                     //每月还款
                 //每月还款
                 case 3:
                     //每季还本
                 //每季还本
                 case 4:
                     //期未还本
                     for ($i = 1; $i <= $binfo['borrow_duration']; $i++) {
                         $repaymentinfo = array();
                         $deadlines = strtotime("+{$i} month", $endTime);
                         //月还款时间
                         $repaymentinfo['deadline'] = $deadlines;
                         $repaymentinfo['status'] = 7;
                         //复审通过,还款中
                         M("investor_detail")->where("invest_id={$investid} AND  `sort_order` ={$i}")->save($repaymentinfo);
                     }
                     break;
                 case 1:
                     //按天一次性还款
                 //按天一次性还款
                 case 5:
                     //一次性还款
                     $repaymentinfo = array();
                     $repaymentinfo['deadline'] = $deadline;
                     //一次性还款时间
                     $repaymentinfo['status'] = 7;
                     //复审通过,还款中
                     M("investor_detail")->where("invest_id=" . $investid)->save($repaymentinfo);
                     break;
             }
             //解冻保证金要减去代金券 20150831
             if ($reqext) {
                 $investor_capital = str2val_money($_POST['TransAmt'] - $reqext);
                 $tip = "第{$borrowid}号标复审通过,冻结本金成为待收金额.使用代金券{$reqext}元";
             } else {
                 $investor_capital = str2val_money($_POST['TransAmt']);
                 $tip = "第{$borrowid}号标复审通过,冻结本金成为待收金额.";
             }
             //因为要给代收金额加上代金券的钱 所以要添加一个变量。20150831 by lj
             memberMoneyLog($data['uid'], 15, $investor_capital, $tip, $binfo['borrow_uid'], '', 0, $reqext);
             file_put_contents('/tmp/debugwhh', date('m-d H:i:s') . "is_null_req:" . print_r($reqext, true) . "\n", FILE_APPEND);
             $daishou = M('investor_detail')->field('interest')->where("investor_uid = {$data['uid']} and borrow_id = {$borrowid} and invest_id ={$investid}")->sum('interest');
             memberMoneyLog($data['uid'], 28, $daishou, "第{$borrowid}号标复审通过,应收利息成为待收利息", $binfo['borrow_uid']);
             //memberMoneyLog($vo['recommend_id'],13,$jiangli,$vo['user_name']."对{$borrow_id}号标投资成功,你获得推广奖励".$jiangli."元。",$v['investor_uid']);
             $id = M("borrow_investor")->field('id')->where("borrow_id=" . $borrowid)->order('id desc')->find();
             if ($id['id'] == $investid) {
                 $borrowinfo = array();
                 $borrowinfo['deadline'] = $deadline;
                 $borrowinfo['borrow_status'] = 6;
                 M("borrow_info")->where("id=" . $borrowid)->save($borrowinfo);
                 //更新借款信息
                 //投标代金券放入客户代收金额*/
                 memberMoneyLog($binfo['borrow_uid'], 17, $binfo['borrow_money'], "第{$borrowid}号标复审通过,借款金额入帐");
                 //投标代金券放入客户代收金额结束*/
                 $total = M("borrow_info")->field("danbao,borrow_money")->where("id=" . $borrowid)->find();
                 //如果担保公司存在
                 if ($total['danbao'] != 0) {
                     $Guar = M('members')->field("usrid,id")->where("id = " . $total['danbao'])->find();
                     $guar_rate = M('member_guarrate')->where("uid = " . $total['danbao'])->find();
                     //担保费率
                     $rates_fee = $guar_rate['guarrate'] * $binfo['borrow_money'] / 100;
                     memberMoneyLog($binfo['borrow_uid'], 104, -$rates_fee, "第{$borrowid}号标借款成功,扣除担保费");
                     //借款者付出担保费
                     memberMoneyLog($Guar['id'], 105, $rates_fee, "第{$borrowid}号标借款成功,获得担保费");
                     //担保者获得担保费
                 }
                 memberMoneyLog($binfo['borrow_uid'], 18, -$binfo['borrow_fee'], "第{$borrowid}号标借款成功,扣除借款管理费");
                 //借款保证金
                 $_P_fee = get_global_setting();
                 $info1 = M("members")->field("usrid")->find($binfo['borrow_uid']);
                 $usrid = $info1['usrid'];
                 $transamt = $_P_fee['money_deposit'] * $total['borrow_money'] / 100;
                 import("ORG.Huifu.Huifu");
                 $huifu = new Huifu();
                 $huifu->usrFreezeBg($usrid, $transamt, $borrowid);
             }
         }
         echo "RECV_ORD_ID_" . $_POST['OrdId'];
     }
 }
Exemplo n.º 20
0
 public function investmoney()
 {
     $jsoncode = file_get_contents("php://input");
     //alogsm("investmoney",0,1,session("u_id").$jsoncode);
     if (!$this->uid) {
         ajaxmsg('请先登录', 0);
         exit;
     }
     $arr = array();
     $arr = json_decode($jsoncode, true);
     if (intval($arr['uid']) != $this->uid) {
         ajaxmsg("查询错误!", 0);
     }
     if (!is_array($arr) || empty($arr) || empty($arr['borrow_id']) || empty($arr['money']) || !in_array($arr['type'], array(3, 4, 5, 6, 7))) {
         ajaxmsg("查询错误!", 0);
     }
     $pre = C('DB_PREFIX');
     //$_pin = $arr['pin'];
     //$pin = md5($_pin);
     $borrow_id = intval($arr['borrow_id']);
     $money = intval($arr['transamt']);
     //		$_pin = "123456";
     //		$pin = md5($_pin);
     //		$borrow_id = 23;
     //		$money = 60;
     //
     $borrow_pass = $arr['borrow_pass'];
     $m = M("member_money")->field('account_money,back_money,money_collect')->find($this->uid);
     $amoney = $m['account_money'] + $m['back_money'];
     $uname = session('u_user_name');
     if ($amoney < $money) {
         ajaxmsg("尊敬的{$uname},您准备投标{$money}元,但您的账户可用余额为{$amoney}元,请先去充值再投标.", 3);
     }
     //$vm = getMinfo($this->uid,'m.pin_pass,mm.account_money,mm.back_money,mm.money_collect');
     //$pin_pass = $vm['pin_pass'];
     //if($pin<>$pin_pass) ajaxmsg("支付密码错误,请重试",2);
     $binfo = M("borrow_info")->field('borrow_money,borrow_max,has_borrow,has_vouch,borrow_type,borrow_min,money_collect')->find($borrow_id);
     ////////////////////////////////////待收金额限制 2013-08-26  fan///////////////////
     if ($binfo['money_collect'] > 0) {
         if ($m['money_collect'] < $binfo['money_collect']) {
             ajaxmsg("此标设置有投标待收金额限制,您账户里必须有足够的待收才能投此标", 3);
         }
     }
     ////////////////////////////////////待收金额限制 2013-08-26  fan///////////////////
     //投标总数检测
     $capital = M('borrow_investor')->where("borrow_id={$borrow_id} AND investor_uid={$this->uid}")->sum('investor_capital');
     if ($capital + $money > $binfo['borrow_max'] && $binfo['borrow_max'] > 0) {
         $xtee = $binfo['borrow_max'] - $capital;
         ajaxmsg("您已投标{$capital}元,此投上限为{$binfo['borrow_max']}元,你最多只能再投{$xtee}", 3);
     }
     //if($binfo['has_vouch']<$binfo['borrow_money'] && $binfo['borrow_type'] == 2) $this->error("此标担保还未完成,您可以担保此标或者等担保完成再投标");
     $need = $binfo['borrow_money'] - $binfo['has_borrow'];
     $caninvest = $need - $binfo['borrow_min'];
     if ($money > $caninvest && $need - $money != 0) {
         $msg = "尊敬的{$uname},此标还差{$need}元满标,如果您投标{$money}元,将导致最后一次投标最多只能投" . ($need - $money) . "元,小于最小投标金额{$binfo['borrow_min']}元,所以您本次可以选择<font color='#FF0000'>满标</font>或者投标金额必须<font color='#FF0000'>小于等于{$caninvest}元</font>";
         if ($caninvest < $binfo['borrow_min']) {
             $msg = "尊敬的{$uname},此标还差{$need}元满标,如果您投标{$money}元,将导致最后一次投标最多只能投" . ($need - $money) . "元,小于最小投标金额{$binfo['borrow_min']}元,所以您本次可以选择<font color='#FF0000'>满标</font>即投标金额必须<font color='#FF0000'>等于{$need}元</font>";
         }
         ajaxmsg($msg, 3);
     }
     if ($need - $money < 0) {
         ajaxmsg("尊敬的{$uname},此标还差{$need}元满标,您最多只能再投{$need}元", 3);
     } else {
         /////////////////////////////////////////////////////汇付托管 2014-10-09///////////////////////////////////////////////////////////////
         $pre = C('DB_PREFIX');
         $info1 = M("huifulog")->distinct(true)->field("usrid")->where("uid=" . $this->uid)->find();
         $info2 = M("huifulog h")->distinct(true)->field("h.usrid")->join("{$pre}borrow_info s ON s.borrow_uid=h.uid")->where("s.id = {$borrow_id}")->find();
         $usrid = $info1['usrid'];
         $borrowerid = $info2['usrid'];
         $transamt = $money;
         $type = "S";
         //表示散标
         $borrowid = $borrow_id;
         import("ORG.Huifu.Huifu");
         $huifu = new Huifu();
         $huifu->initiativeTender($usrid, $transamt, $borrowerid, $type, $borrowid);
         /////////////////////////////////////////////////////汇付托管 END///////////////////////////////////////////////////////////////
         //$done = investMoney($this->uid,$borrow_id,$money);
     }
     //$this->display("Public:_footer");
     //$this->assign("waitSecond",1000);
     /*if($done===true) {
     			$_msg['type'] = $arr['type'];
     			$_msg['id'] = $borrow_id;
     			$_msg['message'] = "恭喜成功投标{$money}元";
     			ajaxmsg($_msg,1);
     			
     		}else if($done){
     			ajaxmsg($done,3);
     		}else{
     			ajaxmsg("对不起,投标失败,请重试!",3);
     		}*/
 }
Exemplo n.º 21
0
 public function autoclose()
 {
     $user = M("members")->field("usrid")->where("id=" . $this->uid)->find();
     $usrid = $user['usrid'];
     import("ORG.Huifu.Huifu");
     $huifu = new Huifu();
     $huifu->autoTenderPlanClose($usrid);
 }
Exemplo n.º 22
0
 public function doEdit()
 {
     $model = D("member_withdrawlog");
     $status = intval($_POST['status']);
     $id = intval($_POST['id']);
     $deal_info = $_POST['deal_info'];
     $usrid = $_POST['usrid'];
     //用户客户号
     $ordid = $_POST['ordid'];
     //订单号
     $transamt = $_POST['transamt'];
     //交易金额
     if ($status == 1) {
         $auditflag = "S";
     } else {
         $auditflag = "R";
     }
     //$secondfee = floatval($_POST['withdraw_fee']);
     $info = $model->field('addtime')->where("id={$id} and (withdraw_status!=0)")->find();
     if ($info['add_time']) {
         $this->error("此提现初审已处理过,请不要重复处理!");
     }
     if (false === $model->create()) {
         $this->error($model->getError());
     }
     //保存当前数据对象
     $model->status = $status;
     $model->deal_info = $deal_info;
     $model->deal_time = time();
     //$model->deal_user=session('adminname');
     ////////////////////////
     $field = 'w.*,w.id,w.uid,(mm.account_money+mm.back_money) all_money,w.feeamt';
     $vo = M("member_withdrawlog w")->field($field)->join("lzh_member_money mm on w.uid = mm.uid")->find($id);
     $um = M('members')->field("user_name,user_phone")->find($vo['uid']);
     $member_money = M('member_money')->field("(back_money +account_money) as moneys")->where("uid = " . $vo['uid'])->find();
     if ($member_money['moneys'] < $transamt + $vo['feeamt']) {
         $this->error(L('用户余额不足,无法提现'));
     }
     if ($status == 1) {
         import("ORG.Huifu.Huifu");
         $huifu = new Huifu();
         //exit("222");
         $res = $huifu->cashAudit($usrid, $ordid, $transamt, $auditflag);
     }
     //exit("333");
     $result = $model->save();
     if ($result) {
         //保存成功
         alogs("withdraw", $id, $status, $deal_info);
         //管理员操作日志
         //成功提示
         $this->assign('jumpUrl', __URL__);
         $this->success(L('修改成功'));
     } else {
         alogs("withdraw", $id, $status, '提现处理操作失败!');
         //管理员操作日志
         //$this->assign("waitSecond",10000);
         //失败提示
         $this->error(L('修改失败'));
     }
 }
Exemplo n.º 23
0
 /**
 +----------------------------------------------------------
 * 默认操作   即使数据
 +----------------------------------------------------------
 */
 public function duizhang()
 {
     if (empty($_POST) || empty($_POST[searchtel])) {
         //分页处理
         import("ORG.Util.Page");
         $dbObj = M('member_moneyfuto mf');
         $total = $dbObj->count();
         $p = new Page($total, 2);
         $page = $p->show();
         $Lsql = "{$p->firstRow},{$p->listRows}";
         $data = $dbObj->where('1=1')->order('uid ASC')->limit($Lsql)->select();
         $dbObj = M('member_info');
         //获取分页的条数
         $backlist = array();
         $row = null;
         $lenght = count($data);
         for ($i = 0; $i < $lenght; $i++) {
             $uid = $data[$i]['uid'];
             $row = $dbObj->field('real_name,cell_phone')->where("uid='{$uid}'")->find();
             $backlist[$i]['blackname'] = $row['real_name'];
             $backlist[$i]['id'] = $uid;
             $backlist[$i]['telephone'] = $row['cell_phone'];
             $backlist[$i]['locmoney'] = $data[$i]['money_usable'];
             $backlist[$i]['money_freeze'] = $data[$i]['money_freeze'];
             $backlist[$i]['money'] = $data[$i]['money_count'];
             $backlist[$i]['Webmoney_money'] = $data[$i]['AvlBal'];
             $backlist[$i]['Webmoney_freeze'] = $data[$i]['FrzBal'];
             $backlist[$i]['Acc'] = $data[$i]['AccBal'];
             //   echo $data[$i]['is_unsual'],'<br/>';
             $backlist[$i]['flage'] = $data[$i]['is_unsual'] == '1' ? 'red' : '';
             //   if($data[$i]['flage'])
         }
         $this->assign('page', $page);
         $this->assign('backlist', $backlist);
         $this->display();
         return;
     }
     $phone = $_POST['searchtel'];
     $pre = C('DB_PREFIX');
     $members = M('members m');
     $data = $members->field("m.usrid as usrid,m.id as id,m.user_name as telephone,\n          mm.money_freeze as money_freeze,mm.account_money as account_money,mm.back_money as back_money")->where("m.user_name='{$phone}' AND usrid !=''")->join("{$pre}member_money mm ON mm.uid=m.id")->select();
     $members = M('member_info');
     import("ORG.Huifu.Huifu");
     $huifu = new Huifu();
     $lenght = count($data);
     for ($i = 0; $i < $lenght; $i++) {
         $id = $data[$i]['id'];
         $name = $members->field('real_name')->where("uid={$id}")->find();
         $data[$i]['locmoney'] = number_format($data[$i]['account_money'] + $data[$i]['back_money'], 2);
         $data[$i]['money'] = number_format($data[$i]['account_money'] + $data[$i]['back_money'] + $data[$i]['money_freeze'], 2);
         $data[$i]['blackname'] = '<b>' . $name['real_name'] . '</b>';
         $data[$i]['money_freeze'] = number_format($data[$i]['money_freeze'], 2);
         $res = $huifu->queryBalanceBg($data[$i]['usrid']);
         $data[$i]['Webmoney_freeze'] = $res['FrzBal'];
         $data[$i]['Webmoney_money'] = $res['AvlBal'];
         $data[$i]['Acc'] = $res['AcctBal'];
         if ($data[$i]['Acc'] != $data[$i]['money']) {
             $data[$i]['flage'] = 'red';
         } else {
             $data[$i]['flage'] = '';
         }
     }
     $this->assign('backlist', $data);
     $this->display();
 }
Exemplo n.º 24
0
 public function delcard()
 {
     $info = M("members")->field("usrid")->where("id=" . $this->uid)->find();
     $usrid = $info['usrid'];
     $bankinfo = M('member_banks')->field("bank_num")->where("uid=" . $this->uid)->find();
     $bankaccount = $bankinfo['bank_num'];
     import("ORG.Huifu.Huifu");
     $huifu = new Huifu();
     $info = $huifu->delCard($usrid, $bankaccount);
     $usrid = $info['UsrCustId'];
     $username = M("huifulog")->distinct(true)->field("uid,username")->where("usrid=" . $usrid)->find();
     $data = array();
     $data['uid'] = $username['uid'];
     $data['username'] = $username['username'];
     $data['rescode'] = $info['RespCode'];
     $data['cmdid'] = $info['CmdId'];
     $data['usrid'] = $info['UsrCustId'];
     $data['trxid'] = "";
     //没有交易流水号
     $data['addtime'] = time();
     M("huifulog")->add($data);
     if (strcmp($_POST['RespCode'], "000") == 0) {
         $bank['bank_num'] = '';
         M('member_banks')->where("uid=" . $this->uid)->save($bank);
     }
 }