Skip to content

Commit

Permalink
Fix add guild page not using QQID.
Browse files Browse the repository at this point in the history
  • Loading branch information
acaly committed Feb 24, 2021
1 parent ca19a3e commit b7f6179
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Pages/Admin/AddGuild.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
<input asp-for="Input.GuildName" class="form-control" />
</div>
<div class="form-group">
<label asp-for="Input.OwnerEmail"></label>
<input asp-for="Input.OwnerEmail" class="form-control" />
<label asp-for="Input.OwnerQQ"></label>
<input asp-for="Input.OwnerQQ" class="form-control" />
</div>
<button id="update-profile-button" type="submit" class="btn btn-primary">Save</button>
</form>
Expand Down
8 changes: 4 additions & 4 deletions Pages/Admin/AddGuild.cshtml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ public class InputModel
{
[Display(Name = "公会名称")]
public string GuildName { get; set; }
[Display(Name = "会长Email")]
public string OwnerEmail { get; set; }
[Display(Name = "会长QQ")]
public ulong OwnerQQ { get; set; }
}

[TempData]
Expand All @@ -43,7 +43,7 @@ public async Task<IActionResult> OnGetAsync()
Input = new InputModel
{
GuildName = "",
OwnerEmail = "",
OwnerQQ = 0,
};
if (!await _context.Bosses.AnyAsync())
{
Expand All @@ -60,7 +60,7 @@ public async Task<IActionResult> OnPostAsync()
}

var owner = _context.Users
.FirstOrDefault(xx => xx.Email == Input.OwnerEmail);
.FirstOrDefault(xx => xx.QQID == Input.OwnerQQ);

if (owner is null)
{
Expand Down

0 comments on commit b7f6179

Please sign in to comment.