增加用户名登录

This commit is contained in:
WispX
2020-02-29 23:06:16 +08:00
parent e7fa6fac11
commit e3880f50e7
4 changed files with 14 additions and 9 deletions
+1 -3
View File
@@ -51,10 +51,8 @@ class Users extends Model
return sprintf("%.2f", $this->hasMany('Images', 'user_id', 'id')->sum('size'));
}
public static function login($account, $password)
public static function login($account, $password, $field = 'email')
{
$field = 'email';
if (!$account) {
throw new Exception('请输入账号');
}