我滴个乖乖
This commit is contained in:
28
ZelWiki.Repository/Scripts/GetAccountProfileByNavigation.sql
Normal file
28
ZelWiki.Repository/Scripts/GetAccountProfileByNavigation.sql
Normal file
@@ -0,0 +1,28 @@
|
||||
SELECT
|
||||
U.UserId,
|
||||
U.Avatar,
|
||||
ANU.Email as EmailAddress,
|
||||
U.AccountName,
|
||||
U.Navigation,
|
||||
U.Biography,
|
||||
(select UC.ClaimValue from AspNetUserClaims as UC WHERE UC.UserId = U.UserId AND UC.ClaimType = 'firstname') as FirstName,
|
||||
(select UC.ClaimValue from AspNetUserClaims as UC WHERE UC.UserId = U.UserId AND UC.ClaimType = 'lastname') as LastName,
|
||||
(select UC.ClaimValue from AspNetUserClaims as UC WHERE UC.UserId = U.UserId AND UC.ClaimType = 'timezone') as TimeZone,
|
||||
(select UC.ClaimValue from AspNetUserClaims as UC WHERE UC.UserId = U.UserId AND UC.ClaimType = 'language') as Language,
|
||||
(select UC.ClaimValue from AspNetUserClaims as UC WHERE UC.UserId = U.UserId AND UC.ClaimType LIKE '%/country') as Country,
|
||||
(select UC.ClaimValue from AspNetUserClaims as UC WHERE UC.UserId = U.UserId AND UC.ClaimType = 'theme') as Theme,
|
||||
U.CreatedDate,
|
||||
U.ModifiedDate,
|
||||
UCR.ClaimValue as Role,
|
||||
ANU.EmailConfirmed
|
||||
FROM
|
||||
Profile as U
|
||||
INNER JOIN AspNetUsers as ANU
|
||||
ON ANU.Id = U.UserId
|
||||
INNER JOIN AspNetUserClaims as UCR
|
||||
ON UCR.UserId = U.UserId
|
||||
AND UCR.ClaimType LIKE '%/role'
|
||||
INNER JOIN Role as R
|
||||
ON R.Name = UCR.ClaimValue
|
||||
WHERE
|
||||
U.Navigation = @Navigation
|
||||
Reference in New Issue
Block a user