/** * 设置响应的消息体 返回值必须是json * */ public function get_response() { //解析出来的用户id 和 用户 手机号码 $user_id = $this->comm_user_infor['id']; $user_name = $this->comm_user_infor['mobile']; //判断用户是否实名认证 // $realName = getRealName($user_id); // if(empty($realName['real_name'])){ // return get_authentication_param($user_name); // exit; // } $usrid = get_user_usrid($user_id); if (empty($usrid)) { $this->result['code'] = 500; $this->result['msg'] = "账号还未进行实名认证,请到更多->我的账户->身份认证"; return; } $bankInfo = getBankNum($user_id); if (empty($bankInfo)) { return bandBank($usrid); } else { $this->result['code'] = 111; $this->result['msg'] = "该账号已绑定银行卡"; return false; } }
/** * 设置响应的消息体 返回值必须是json * */ public function get_response() { //传入的参数,取消的金额 amount $amount = $this->request_arr['amount']; //解析出来的用户id 和 用户 手机号码 $user_id = $this->comm_user_infor['id']; $user_name = $this->comm_user_infor['mobile']; $blackList = $this->getBlackList(); if (in_array($user_name, $blackList)) { $this->result['code'] = 113; return; } $usrid = get_user_usrid($user_id); if (empty($usrid)) { $this->result['code'] = 500; $this->result['msg'] = "账号还未进行实名认证,请到更多->我的账户->身份认证"; return; } //判断用户是否实名认证 //$realName = getRealName($user_id); // if(empty($realName['real_name'])){ // return get_authentication_param($user_name); // exit; // } //手续费的算法还需要调整 千3 $fee = $amount * 3 / 1000; //汇付那边标记的用户id $usrid = get_user_usrid($user_id); //判断用户是否绑定银行卡 $bankInfo = getBankNum($user_id); if (empty($bankInfo)) { $this->result['code'] = 501; $this->result['msg'] = "该账号暂未绑定银行卡,请到更多->我的账户->绑定银行卡"; return; //return bandBank($usrid); } $userMoney = $this->getUserMoney($user_id); $accountMoney = $userMoney['account_money'] + $userMoney['back_money']; if ($amount > $accountMoney) { $this->result['code'] = 112; $this->result['msg'] = "提现金额不能超过账号余额"; return false; } $data['act'] = 'withdrawals.get'; $data['usrid'] = $usrid; $data['amount'] = $amount; $data['fee'] = $fee; $data['cashChl'] = ''; //取款方式 //return $data; return goHuiFuPlant($data); }