/** * 记录用户绑定信息 * @param $uid * @param $identityid * @param $requestid * @param $cardno * @param $idcardno * @param $username * @param $phone * @param $userip * @param $from * @param string $status * @param string $error_msg * @param string $bankcode * @param string $card_top * @param string $card_last * @return bool * */ private static function bandingLog($uid, $identityid, $requestid, $cardno, $idcardno, $username, $phone, $userip, $from, $status = '', $error_msg = '', $bankcode = '', $card_top = '', $card_last = '') { $bind = new Bindbankcard(); $bind->uid = $uid; $bind->identityid = $identityid; $bind->requestid = $requestid; $bind->cardno = $cardno; $bind->idcardno = $idcardno; $bind->username = $username; $bind->phone = $phone; $bind->userip = $userip; $bind->from = $from; $bind->status = $status; $bind->error_msg = $error_msg; $bind->bankcode = $bankcode; $bind->card_top = $card_top; $bind->card_last = $card_last; $res = $bind->save(); return $res; }
/** * 判定用户是否已经绑定银行卡 * @param $uid 用户id * @return bool * @throws ErrorException */ public static function isBinding($uid) { $info = Bindbankcard::findOne(['uid' => $uid, 'status' => Balance::SUCCEED]); if ($info) { $data['cardno'] = $info['cardno']; $data['idcardno'] = $info['idcardno']; $data['username'] = $info['username']; $data['phone'] = $info['phone']; return $data; } else { return false; } }
/** * 判定用户是否已经绑定银行卡 * @param $uid 用户id * @return bool * @throws ErrorException */ public static function isBinding($uid) { $info = Bindbankcard::findOne(['uid' => $uid, 'status' => yeepay::SUCCEED]); if ($info) { $data['cardno'] = $info['cardno']; $data['phone'] = $info['phone']; $return = array('errorNum' => '0', 'errorMsg' => 'success', 'data' => $data); return $return; } else { $return = array('errorNum' => '1', 'errorMsg' => '未进行绑定', 'data' => null); return $return; } }