|
|
@@ -17,7 +17,8 @@
|
|
|
spr.role_name COLLATE utf8mb4_unicode_ci AS roleName,
|
|
|
spur.user_id AS userId,
|
|
|
spur.account_name COLLATE utf8mb4_unicode_ci AS accountName,
|
|
|
- su.phone COLLATE utf8mb4_unicode_ci AS phone
|
|
|
+ su.phone COLLATE utf8mb4_unicode_ci AS phone,
|
|
|
+ spur.status AS status
|
|
|
FROM
|
|
|
store_platform_user_role spur
|
|
|
INNER JOIN store_user su ON spur.user_id = su.id
|
|
|
@@ -44,7 +45,8 @@
|
|
|
NULL AS roleName,
|
|
|
su_main.id AS userId,
|
|
|
su_main.name COLLATE utf8mb4_unicode_ci AS accountName,
|
|
|
- su_main.phone COLLATE utf8mb4_unicode_ci AS phone
|
|
|
+ su_main.phone COLLATE utf8mb4_unicode_ci AS phone,
|
|
|
+ NULL AS status
|
|
|
FROM
|
|
|
store_user su_main
|
|
|
LEFT JOIN store_info si_main ON su_main.store_id = si_main.id
|
|
|
@@ -85,7 +87,8 @@
|
|
|
spr.role_name COLLATE utf8mb4_unicode_ci AS roleName,
|
|
|
spur.user_id AS userId,
|
|
|
spur.account_name COLLATE utf8mb4_unicode_ci AS accountName,
|
|
|
- su.phone COLLATE utf8mb4_unicode_ci AS phone
|
|
|
+ su.phone COLLATE utf8mb4_unicode_ci AS phone,
|
|
|
+ spur.status AS status
|
|
|
FROM
|
|
|
store_platform_user_role spur
|
|
|
INNER JOIN store_user su ON spur.user_id = su.id
|
|
|
@@ -111,14 +114,15 @@
|
|
|
NULL AS roleName,
|
|
|
su_main.id AS userId,
|
|
|
su_main.name COLLATE utf8mb4_unicode_ci AS accountName,
|
|
|
- su_main.phone COLLATE utf8mb4_unicode_ci AS phone
|
|
|
+ su_main.phone COLLATE utf8mb4_unicode_ci AS phone,
|
|
|
+ NULL AS status
|
|
|
FROM
|
|
|
store_user su_main
|
|
|
INNER JOIN store_info si_main ON su_main.store_id = si_main.id
|
|
|
WHERE
|
|
|
(
|
|
|
-- 如果传入的是子账号,查询其主账号的门店
|
|
|
- (su_main.id = (SELECT sub_account_id FROM store_user WHERE id = #{userId} AND account_type = 2 AND delete_flag = 0 LIMIT 1))
|
|
|
+ (su_main.id = (SELECT id FROM store_user WHERE id = #{userId} AND account_type = 2 AND delete_flag = 0 LIMIT 1))
|
|
|
OR
|
|
|
-- 如果传入的是主账号,查询自己的门店
|
|
|
(su_main.id = #{userId} AND su_main.account_type = 1)
|