diff --git a/app/Filament/Resources/Torrent/TorrentResource.php b/app/Filament/Resources/Torrent/TorrentResource.php
index 1d2a168f..68774438 100644
--- a/app/Filament/Resources/Torrent/TorrentResource.php
+++ b/app/Filament/Resources/Torrent/TorrentResource.php
@@ -19,6 +19,8 @@ use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletingScope;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Auth;
+use Illuminate\Support\HtmlString;
+use Illuminate\Support\Str;
class TorrentResource extends Resource
{
@@ -54,18 +56,27 @@ class TorrentResource extends Resource
->columns([
Tables\Columns\TextColumn::make('id')->sortable(),
Tables\Columns\BadgeColumn::make('basic_category.name')->label(__('label.torrent.category')),
- Tables\Columns\TextColumn::make('name')
- ->label(__('label.name'))
- ->limit(30)
- ->url(fn ($record) => sprintf('/details.php?id=%s', $record->id))
- ->openUrlInNewTab(true)
- ,
- Tables\Columns\BadgeColumn::make('posStateText')->label(__('label.torrent.pos_state')),
- Tables\Columns\BadgeColumn::make('spStateText')->label(__('label.torrent.sp_state')),
- Tables\Columns\TextColumn::make('tagsFormatted')->label(__('label.tag.label'))->html(),
+ Tables\Columns\TextColumn::make('name')->formatStateUsing(function (Torrent $record) {
+ $sticky = sprintf(
+ '
%s
',
+ $record->posStateText
+ );
+ $name = sprintf(
+ '',
+ Str::limit($record->name, 40)
+ );
+ $promotion = sprintf(
+ '%s
',
+ $record->spStateText
+ );
+ $tags = sprintf('%s
', $record->tagsFormatted);
+
+ return new HtmlString('' . $sticky . $name . $promotion . $tags . '
');
+ }),
Tables\Columns\TextColumn::make('size')->label(__('label.torrent.size'))->formatStateUsing(fn ($state) => mksize($state)),
Tables\Columns\TextColumn::make('seeders')->label(__('label.torrent.seeders')),
Tables\Columns\TextColumn::make('leechers')->label(__('label.torrent.leechers')),
+// Tables\Columns\TextColumn::make('times_completed')->label(__('label.torrent.times_completed')),
Tables\Columns\BadgeColumn::make('approval_status')
->label(__('label.torrent.approval_status'))
->colors(array_flip(Torrent::listApprovalStatus(true, 'badge_color')))
@@ -104,8 +115,6 @@ class TorrentResource extends Resource
,
Forms\Components\Textarea::make('comment')->label(__('label.comment')),
])
- ->icon('heroicon-o-check')
- ->color('success')
->action(function (Torrent $record, array $data) {
$torrentRep = new TorrentRepository();
try {
@@ -195,4 +204,5 @@ class TorrentResource extends Resource
'edit' => Pages\EditTorrent::route('/{record}/edit'),
];
}
+
}
diff --git a/app/Repositories/ClaimRepository.php b/app/Repositories/ClaimRepository.php
index 0bd31605..5a549947 100644
--- a/app/Repositories/ClaimRepository.php
+++ b/app/Repositories/ClaimRepository.php
@@ -235,12 +235,14 @@ class ClaimRepository extends BaseRepository
}
//Update claim `last_settle_at` and init `seed_time_begin` & `uploaded_begin`
- $sql = sprintf(
- "update claims set uploaded_begin = case id %s end, seed_time_begin = case id %s end, last_settle_at = '%s', updated_at = '%s' where id in (%s)",
- implode(' ', $uploadedCaseWhen), implode(' ', $seedTimeCaseWhen), $now->toDateTimeString(), $now->toDateTimeString(), implode(',', $toUpdateIdArr)
- );
- $affectedRows = DB::update($sql);
- do_log("query: $sql, affectedRows: $affectedRows");
+ if (!empty($toUpdateIdArr)) {
+ $sql = sprintf(
+ "update claims set uploaded_begin = case id %s end, seed_time_begin = case id %s end, last_settle_at = '%s', updated_at = '%s' where id in (%s)",
+ implode(' ', $uploadedCaseWhen), implode(' ', $seedTimeCaseWhen), $now->toDateTimeString(), $now->toDateTimeString(), implode(',', $toUpdateIdArr)
+ );
+ $affectedRows = DB::update($sql);
+ do_log("query: $sql, affectedRows: $affectedRows");
+ }
//Send message
Message::query()->insert($message);
diff --git a/include/constants.php b/include/constants.php
index 158d5b2a..e6e31ed8 100644
--- a/include/constants.php
+++ b/include/constants.php
@@ -1,6 +1,6 @@