minor fixes
This commit is contained in:
@@ -50,9 +50,10 @@ final class ArtworkStudioProvider implements CreatorStudioProvider
|
||||
$draftCount = (clone $baseQuery)
|
||||
->whereNull('deleted_at')
|
||||
->where(function (Builder $query): void {
|
||||
$query->where('is_public', false)
|
||||
->orWhere('artwork_status', 'draft');
|
||||
$query->whereNull('artwork_status')
|
||||
->orWhere('artwork_status', '!=', 'scheduled');
|
||||
})
|
||||
->where('is_public', false)
|
||||
->count();
|
||||
|
||||
$publishedCount = (clone $baseQuery)
|
||||
@@ -92,16 +93,29 @@ final class ArtworkStudioProvider implements CreatorStudioProvider
|
||||
$query = Artwork::query()
|
||||
->withTrashed()
|
||||
->where('user_id', $user->id)
|
||||
->with(['stats', 'categories', 'tags'])
|
||||
->with([
|
||||
'stats',
|
||||
'categories',
|
||||
'tags',
|
||||
'features' => function ($query): void {
|
||||
$query->where('is_active', true)
|
||||
->whereNull('deleted_at')
|
||||
->where(function (Builder $builder): void {
|
||||
$builder->whereNull('expires_at')
|
||||
->orWhere('expires_at', '>', now());
|
||||
});
|
||||
},
|
||||
])
|
||||
->orderByDesc('updated_at')
|
||||
->limit($limit);
|
||||
|
||||
if ($bucket === 'drafts') {
|
||||
$query->whereNull('deleted_at')
|
||||
->where(function (Builder $builder): void {
|
||||
$builder->where('is_public', false)
|
||||
->orWhere('artwork_status', 'draft');
|
||||
});
|
||||
$builder->whereNull('artwork_status')
|
||||
->orWhere('artwork_status', '!=', 'scheduled');
|
||||
})
|
||||
->where('is_public', false);
|
||||
} elseif ($bucket === 'scheduled') {
|
||||
$query->whereNull('deleted_at')
|
||||
->where('artwork_status', 'scheduled');
|
||||
@@ -199,7 +213,7 @@ final class ArtworkStudioProvider implements CreatorStudioProvider
|
||||
'published_at' => $artwork->published_at?->toIso8601String(),
|
||||
'scheduled_at' => $artwork->publish_at?->toIso8601String(),
|
||||
'schedule_timezone' => $artwork->artwork_timezone,
|
||||
'featured' => false,
|
||||
'featured' => $artwork->features->isNotEmpty(),
|
||||
'metrics' => [
|
||||
'views' => (int) ($stats?->views ?? 0),
|
||||
'appreciation' => (int) ($stats?->favorites ?? 0),
|
||||
|
||||
Reference in New Issue
Block a user