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 }
public function dowithdraw() { //echo "<pre>";print_r($_POST);echo "</pre>";exit; $tuoguan = FS("Webconfig/tuoguanconfig"); $usrid = $tuoguan['huifu']['MerCustId']; $transamt = $_POST['money']; import("ORG.Huifu.Huifu"); $huifu = new Huifu(); $huifu->cash($usrid, $transamt); }