finish plugin: sticky promotion

This commit is contained in:
xiaomlove
2022-06-08 14:15:59 +08:00
parent 44c750234a
commit 09f6e5b274
62 changed files with 954 additions and 178 deletions

View File

@@ -676,10 +676,11 @@ class SearchRepository extends BaseRepository
foreach ($response['hits']['hits'] as $value) {
$torrentIdArr[] = $value['_source']['torrent_id'];
}
$fieldStr = 'id, sp_state, promotion_time_type, promotion_until, banned, picktype, pos_state, category, source, medium, codec, standard, processing, team, audiocodec, leechers, seeders, name, small_descr, times_completed, size, added, comments,anonymous,owner,url,cache_stamp, pt_gen, hr';
// $fieldStr = 'id, sp_state, promotion_time_type, promotion_until, banned, picktype, pos_state, category, source, medium, codec, standard, processing, team, audiocodec, leechers, seeders, name, small_descr, times_completed, size, added, comments,anonymous,owner,url,cache_stamp, pt_gen, hr';
$fields = Torrent::getFieldsForList();
$idStr = implode(',', $torrentIdArr);
$result['data'] = Torrent::query()
->selectRaw($fieldStr)
->select($fields)
->whereIn('id', $torrentIdArr)
->orderByRaw("field(id,$idStr)")
->get()