|
@@ -353,7 +353,15 @@ namespace GxPress.Repository.Implement
|
|
|
{
|
|
|
if (user == null) throw new Exception("用户不能为空");
|
|
|
if (string.IsNullOrEmpty(user.Name)) throw new Exception("用户不能为空");
|
|
|
-
|
|
|
+ if (!string.IsNullOrEmpty(user.Phone) &&
|
|
|
+ await _repository.ExistsAsync(Q.Where(nameof(User.Phone), user.Phone).Where(nameof(User.IsDelete), true)))
|
|
|
+ {
|
|
|
+ var userModel = await GetByPhoneAsync(user.Phone);
|
|
|
+ user.IsDelete = false;
|
|
|
+ user.Id = userModel.Id;
|
|
|
+ await _repository.UpdateAsync(user);
|
|
|
+ return userModel.Id;
|
|
|
+ }
|
|
|
if (!string.IsNullOrEmpty(user.Phone) &&
|
|
|
await _repository.ExistsAsync(Q.Where(nameof(User.Phone), user.Phone)))
|
|
|
{
|