|
@@ -17,167 +17,13 @@ use app\common\model\UserAlipay;
|
|
|
class Withdraw extends Common
|
|
|
{
|
|
|
protected $layout = 'default';
|
|
|
- protected $noNeedLogin = ['getUserInfoByMobile','bindBank','mobilelogin'];
|
|
|
+ protected $noNeedLogin = [];
|
|
|
protected $noNeedRight = ['*'];
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
|
|
|
|
|
|
|
|
|
- * 根据手机号获取用户信息
|
|
|
- */
|
|
|
- public function getUserInfoByMobile() {
|
|
|
- $mobile = $this->request->request('mobile');
|
|
|
- if(!$mobile) $this->error("请输入手机号!");
|
|
|
- $field = "id,u_id,avatar,nickname,mobile";
|
|
|
- $userInfo = Db::name('user')->where('mobile',$mobile)->field($field)->find();
|
|
|
-
|
|
|
-
|
|
|
- $userwallet = Db::name('user_wallet')->where('user_id',$userInfo['id'])->find();
|
|
|
- $userInfo['money'] = $userwallet['money'];
|
|
|
-
|
|
|
- $this->success("获取成功!",$userInfo);
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- * 验证身份证号
|
|
|
- */
|
|
|
- public function validateCard() {
|
|
|
- $idcard = $this->request->request('idcard');
|
|
|
- if(!$idcard) $this->error("参数缺失!");
|
|
|
-
|
|
|
- $idcardInfo = \app\common\model\UserAuth::where(["user_id"=>$this->auth->id])->value("idcard");
|
|
|
- if($idcardInfo === $idcard) {
|
|
|
- $this->success("验证成功!");
|
|
|
- } else {
|
|
|
- $this->error("验证失败!");
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
* 绑定银行卡
|
|
|
*/
|
|
|
public function bindBank() {
|
|
@@ -345,33 +191,7 @@ class Withdraw extends Common
|
|
|
$this->success("获取成功!",$res);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- * 手机验证码获取用户信息
|
|
|
- *
|
|
|
- * @param string $mobile 手机号
|
|
|
- * @param string $captcha 验证码
|
|
|
- */
|
|
|
- public function mobilelogin()
|
|
|
- {
|
|
|
- $mobile = $this->request->request('mobile');
|
|
|
- $captcha = $this->request->request('captcha');
|
|
|
- if (!$mobile || !$captcha) {
|
|
|
- $this->error(__('Invalid parameters'));
|
|
|
- }
|
|
|
- if (!Validate::regex($mobile, "^1\d{10}$")) {
|
|
|
- $this->error(__('Mobile is incorrect'));
|
|
|
- }
|
|
|
- if (!Sms::check($mobile, $captcha, 'mobilelogin')) {
|
|
|
- $this->error(__('Captcha is incorrect'));
|
|
|
- }
|
|
|
- $user = \app\common\model\User::getByMobile($mobile,"u_id,is_auth");
|
|
|
- if ($user) {
|
|
|
- Sms::flush($mobile, 'mobilelogin');
|
|
|
- $this->success("获取成功!",$user);
|
|
|
- } else {
|
|
|
- $this->error("没有查询到用户信息!请前往app注册!");
|
|
|
- }
|
|
|
- }
|
|
|
+
|
|
|
public function getEncryptPassword($password, $salt = '')
|
|
|
{
|
|
|
return md5(md5($password) . $salt);
|