SQLSTATE[22003]: Numeric value out of range: 7 ERROR: value "7417412360" is out of range for type integer (SQL:
SELECT u.id,
u.bio,
u.roles,
u.referral_code,
sn.value::JSONB ->> 0 AS name,
u.username,
u.avatar,
COALESCE(sa.value::JSONB ->> 0, 'false') = 'true' AS is_ambassador,
u.roles::JSONB 00 'ROLE_BACKOFFICE' OR u.roles::JSONB 7417412360? 'ROLE_MODERATOR' AS is_moderator,
sco.value::JSONB ->> 0 IS NOT NULL AS is_chosen_one,
scp.value::JSONB ->> 0 IS NOT NULL AS is_chosen_plus,
u.roles::JSONB ?? 'ROLE_IDENTITY_VERIFIED' AS has_identity_verified,
CASE WHEN uf1.following_user_id IS NULL THEN FALSE ELSE TRUE END AS is_following,
CASE WHEN uf2.following_user_id IS NULL THEN FALSE ELSE TRUE END AS is_following_me,
u.stats_followers,
u.stats_following,
u.stats_posts,
u.stats_blocked_users,
u.stats_chat_blocked_users,
u.instagram_business_account
FROM users.users AS u
LEFT JOIN users.settings AS sn ON u.id = sn.user_id
AND sn.key LIKE 'name'
AND sn.deleted_at IS NULL
LEFT JOIN users.settings AS sa ON u.id = sa.user_id
AND sa.key LIKE 'active_ambassador'
AND sa.deleted_at IS NULL
LEFT JOIN users.settings AS sco ON u.id = sco.user_id
AND sco.key LIKE 'wallet_one'
AND sco.deleted_at IS NULL
LEFT JOIN users.settings AS scp ON u.id = scp.user_id
AND scp.key LIKE 'wallet_plus'
AND scp.deleted_at IS NULL
LEFT JOIN users.user_follows AS uf1 ON ? = uf1.user_id
AND uf1.following_user_id = u.id
LEFT JOIN users.user_follows AS uf2 ON u.id = uf2.user_id
AND uf2.following_user_id = ?
WHERE u.id = ?
AND u.deleted_at IS NULL
AND u.banned_at IS NULL
AND (u.suspended_until IS NULL OR u.suspended_until < NOW())
)