public function withdraw() { import("ORG.Loan.Escrow"); $loan = new Escrow(); if ($loan->withdrawVerify($_POST)) { $orders = $_POST['OrderNo']; $id = substr($orders, 12); $vo = M('member_withdraw')->field('uid,withdraw_money,withdraw_fee,withdraw_status, loanno')->where("id={$id}")->find(); $uid = $vo['uid']; if ($_POST['ResultCode'] == '88' && !$vo['withdraw_status']) { // 成功 $FreeLimit = $_POST['FreeLimit']; $FeeWithdraws = $_POST['FeeWithdraws']; $Amount = $_POST['Amount']; $updata['withdraw_status'] = 1; $updata['second_fee'] = $_POST['FeeWithdraws']; $updata['withdraw_fee'] = $FeeWithdraws; $updata['loanno'] = $_POST['LoanNo']; $xid = M('member_withdraw')->where("uid={$vo['uid']} AND id={$id}")->save($updata); if ($xid) { $amoney = $_POST['Amount'] - $_POST['FeeWithdraws']; memberMoneyLog($uid, 29, $_POST['Amount'], "提现成功,扣除实际手续费" . $FeeWithdraws . "元,到帐金额" . $amoney . "元", '0', '@网站管理员@', 0); MTip('chk6', $uid); echo "SUCCESS"; notifyMsg('提现', $_POST, 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], 'SUCCESS'); exit; } } elseif ($_POST['ResultCode'] == '89' && $vo['withdraw_status'] == 1) { //退回资金 $updata['withdraw_status'] = 2; $xid = M('member_withdraw')->where("uid={$uid} AND id={$id}")->save($updata); if ($xid) { memberMoneyLog($uid, 5, $_POST['Amount'], "提现退回资金{$_POST['Amount']}元", '0', '@网站管理员@', 0); notifyMsg('提现退回', $_POST, 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], 'SUCCESS'); echo "SUCCESS"; exit; } } notifyMsg('提现', $_POST, 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], ''); } }
/** * 提现通知地址 * */ public function withdraw() { if ($_POST['ResultCode'] == '88') { import("ORG.Loan.Escrow"); $loan = new Escrow(); if ($loan->withdrawVerify($_POST)) { $updata['withdraw_status'] = 1; $id = $_REQUEST['OrderNo']; $vo = M('member_withdraw')->field('uid,money,fee,member_status')->where("id='{$id}'")->find(); //if($vo['status']!=0 || !is_array($vo)) return; $xid = $withdrawlog->where("uid={$vo['uid']} AND id='{$id}'")->save($updata); $tmoney = floatval($vo['money'] - $vo['fee']); memberMoneyLog($this->uid, 4, -$withdraw_money, "提现,默认自动扣减手续费" . $fee . "元", '0', '@网站管理员@', 0); MTip('chk6', $this->uid); if (M('member_withdraw')->save($updata)) { notifyMsg('提现', $_POST, 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], 'SUCCESS'); echo "SUCCESS"; exit; } notifyMsg('提现', $_POST, 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], ''); } } }