mirror of
https://github.com/NNTmux/newznab-tmux.git
synced 2026-08-29 00:01:21 +00:00
Fix release stats
This commit is contained in:
@@ -20,10 +20,13 @@ class ReleaseStat extends Model
|
||||
'categories.id')->groupBy('title')->orderByDesc('count')->get();
|
||||
|
||||
foreach ($categories as $category) {
|
||||
self::updateOrCreate([
|
||||
'category' => $category->title,
|
||||
'count' => $category->count,
|
||||
]);
|
||||
// Check if we already have the information and if we do just update the count
|
||||
if (self::query()->where('category', $category->title)->exists()) {
|
||||
self::query()->where('category', $category->title)->update(['count' => $category->count]);
|
||||
|
||||
continue;
|
||||
}
|
||||
self::query()->create(['category' => $category->title, 'count' => $category->count]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user