songxingwei 3 роки тому
батько
коміт
648708d571

+ 1 - 1
application/api/controller/Login.php

@@ -89,7 +89,7 @@ class Login extends Api
                 $this->error('短信验证码为空');
             }
         }
-        $result = User::login($phone,$password,$type,$ver_code,$come);
+        $result = User::login($phone,$password,$type,$ver_code);
         if ($result['code']){
             $this->success($result['msg'],$result['data']);
         }else{

+ 1 - 47
application/common/model/User.php

@@ -71,7 +71,7 @@ class User Extends Model
     /**
      * 登录
      */
-    public static function login($phone,$password,$type,$ver_code,$come){
+    public static function login($phone,$password,$type,$ver_code){
         $phone_use = self::where('phone',$phone)->find();
         if (!$phone_use){
             return Common::return_error('手机号未注册!');
@@ -95,52 +95,6 @@ class User Extends Model
                 return Common::return_error('短信验证码不正确!');
             }
         }
-        if ($come==2){
-            $info = $phone_use;
-            if (!$info['skills_label']){
-                $info['skills_label'] = [];
-            }else{
-                $info['skills_label'] = explode(',', $info['skills_label']);
-            }
-            if (!$info['good_type']){
-                $info['good_type'] = [];
-            }else{
-                $info['good_type'] = explode(',', $info['good_type']);
-            }
-            if (!$info['good_style']){
-                $info['good_style'] = [];
-            }else{
-                $info['good_style'] = explode(',', $info['good_style']);
-            }
-            if (!$info['related_certificate']){
-                $info['related_certificate'] = [];
-            }else{
-                $info['related_certificate'] = explode(',', $info['related_certificate']);
-            }
-            if (!$info['works']){
-                $info['works'] = [];
-            }else{
-                $info['works'] = explode(',', $info['works']);
-            }
-            $data['info'] = $phone_use;
-            if ($phone_use['type']==1 && $phone_use['audit']==0){
-                $data['type'] = 1;
-            }elseif ($phone_use['type']==1 && $phone_use['audit']==1){
-                $data['type'] = 2;
-            }elseif ($phone_use['type']==1 && $phone_use['audit']==3){
-                $data['type'] = 3;
-            }else{
-                $data['type'] = 4;
-            }
-            $data['token'] = "";
-            if ($data['type']==4){
-                self::where('id',$phone_use['id'])->update(['ip'=>request()->ip()]);
-                LoginLog::create(['user_id'=>$phone_use['id'],'ip'=>request()->ip()]);
-                $token = JWT::encode($phone_use,config('jwt.key'));
-                $data['token'] = $token;
-            }
-            return Common::return_success('成功',$data);
-        }
         self::where('id',$phone_use['id'])->update(['ip'=>request()->ip()]);
         LoginLog::create(['user_id'=>$phone_use['id'],'ip'=>request()->ip()]);
         $token = JWT::encode($phone_use,config('jwt.key'));