Wire admin studio SSR and search infrastructure
This commit is contained in:
@@ -149,7 +149,7 @@ final class CommunityActivityService
|
||||
$query
|
||||
->select('id', 'name', 'username', 'role', 'is_active', 'created_at')
|
||||
->with('profile:user_id,avatar_hash')
|
||||
->withCount('artworks');
|
||||
->with('statistics:user_id,uploads_count');
|
||||
},
|
||||
])
|
||||
->whereHas('actor', fn ($query) => $query->where('is_active', true)->whereNull('deleted_at'))
|
||||
@@ -210,7 +210,7 @@ final class CommunityActivityService
|
||||
: User::query()
|
||||
->select('id', 'name', 'username', 'role', 'is_active', 'created_at')
|
||||
->with('profile:user_id,avatar_hash')
|
||||
->withCount('artworks')
|
||||
->with('statistics:user_id,uploads_count')
|
||||
->whereIn('id', $targetUserIds)
|
||||
->where('is_active', true)
|
||||
->whereNull('deleted_at')
|
||||
@@ -242,7 +242,7 @@ final class CommunityActivityService
|
||||
$query
|
||||
->select('id', 'name', 'username', 'role', 'is_active', 'created_at')
|
||||
->with('profile:user_id,avatar_hash')
|
||||
->withCount('artworks');
|
||||
->with('statistics:user_id,uploads_count');
|
||||
},
|
||||
'artwork' => function ($query) {
|
||||
$query->select('id', 'user_id', 'title', 'slug', 'hash', 'thumb_ext', 'published_at', 'deleted_at', 'is_public', 'is_approved');
|
||||
@@ -271,7 +271,7 @@ final class CommunityActivityService
|
||||
$query
|
||||
->select('id', 'name', 'username', 'role', 'is_active', 'created_at')
|
||||
->with('profile:user_id,avatar_hash')
|
||||
->withCount('artworks');
|
||||
->with('statistics:user_id,uploads_count');
|
||||
},
|
||||
'comment' => function ($query) {
|
||||
$query
|
||||
@@ -281,7 +281,7 @@ final class CommunityActivityService
|
||||
$userQuery
|
||||
->select('id', 'name', 'username', 'role', 'is_active', 'created_at')
|
||||
->with('profile:user_id,avatar_hash')
|
||||
->withCount('artworks');
|
||||
->with('statistics:user_id,uploads_count');
|
||||
},
|
||||
'artwork' => function ($artworkQuery) {
|
||||
$artworkQuery->select('id', 'user_id', 'title', 'slug', 'hash', 'thumb_ext', 'published_at', 'deleted_at', 'is_public', 'is_approved');
|
||||
@@ -408,13 +408,13 @@ final class CommunityActivityService
|
||||
$query
|
||||
->select('id', 'name', 'username', 'role', 'is_active', 'created_at')
|
||||
->with('profile:user_id,avatar_hash')
|
||||
->withCount('artworks');
|
||||
->with('statistics:user_id,uploads_count');
|
||||
},
|
||||
'mentionedUser' => function ($query) {
|
||||
$query
|
||||
->select('id', 'name', 'username', 'role', 'is_active', 'created_at')
|
||||
->with('profile:user_id,avatar_hash')
|
||||
->withCount('artworks');
|
||||
->with('statistics:user_id,uploads_count');
|
||||
},
|
||||
'comment' => function ($query) {
|
||||
$query
|
||||
@@ -424,7 +424,7 @@ final class CommunityActivityService
|
||||
$userQuery
|
||||
->select('id', 'name', 'username', 'role', 'is_active', 'created_at')
|
||||
->with('profile:user_id,avatar_hash')
|
||||
->withCount('artworks');
|
||||
->with('statistics:user_id,uploads_count');
|
||||
},
|
||||
'artwork' => function ($artworkQuery) {
|
||||
$artworkQuery->select('id', 'user_id', 'title', 'slug', 'hash', 'thumb_ext', 'published_at', 'deleted_at', 'is_public', 'is_approved');
|
||||
@@ -489,7 +489,7 @@ final class CommunityActivityService
|
||||
return ['label' => 'Moderator', 'tone' => 'amber'];
|
||||
}
|
||||
|
||||
if ((int) ($user->artworks_count ?? 0) > 0) {
|
||||
if ((int) ($user->statistics?->uploads_count ?? 0) > 0) {
|
||||
return ['label' => 'Creator', 'tone' => 'sky'];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user