cqpCow 1 vuosi sitten
vanhempi
commit
7cd1c239ab
1 muutettua tiedostoa jossa 6 lisäystä ja 1 poistoa
  1. 6 1
      app/Service/EmployeeService.php

+ 6 - 1
app/Service/EmployeeService.php

@@ -823,11 +823,16 @@ class EmployeeService extends Service
         if($this->isEmpty($data,'account')) return [false,'账号不能为空!'];
         if($this->isEmpty($data,'password')) return [false,'密码不存在!'];
 
+        $account = $data['account'];
         $res = Employee::where('del_time',0)
-            ->where('account', $data['account'])
+            ->where(function ($query)use($account) {
+                $query->where('account', $account)
+                    ->orWhere('mobile', $account);
+            })
             ->get()->toArray();
 
         if(empty($res)) return [false,'账号不存在或已被删除!'];
+        if(count($res) > 1) return [false,'该手机号检测出多个账户,请联系后台!'];
 
         $res = reset($res);
         if(! Hash::check($data['password'], $res['password'])) return [false,'密码错误!'];