fix rss sticky prepend

This commit is contained in:
xiaomlove
2023-01-20 22:52:17 +08:00
parent 1031056830
commit 6e2531e571
2 changed files with 4 additions and 3 deletions

View File

@@ -1,6 +1,6 @@
<?php
defined('VERSION_NUMBER') || define('VERSION_NUMBER', '1.8.0');
defined('RELEASE_DATE') || define('RELEASE_DATE', '2023-01-16');
defined('RELEASE_DATE') || define('RELEASE_DATE', '2023-01-20');
defined('IN_TRACKER') || define('IN_TRACKER', false);
defined('PROJECTNAME') || define("PROJECTNAME","NexusPHP");
defined('NEXUSPHPURL') || define("NEXUSPHPURL","https://nexusphp.org");

View File

@@ -166,7 +166,7 @@ if (!$noNormalResults) {
$query = "SELECT $fieldStr FROM torrents LEFT JOIN categories ON category = categories.id $normalWhere ORDER BY $sort LIMIT $limit";
$normalRows = \Nexus\Database\NexusDB::select($query);
}
if (!empty($prependIdArr) && $startindex > 0) {
if (!empty($prependIdArr) && $startindex == 0) {
$prependIdStr = implode(',', $prependIdArr);
$prependRows = \Nexus\Database\NexusDB::select("SELECT $fieldStr FROM torrents LEFT JOIN categories ON category = categories.id where torrents.id in ($prependIdStr) and $where ORDER BY field(torrents.id, $prependIdStr)");
}
@@ -180,7 +180,8 @@ foreach ($normalRows as $row) {
}
}
//dd($prependIdArr, $prependRows, $normalRows, $list);
//dd($prependIdArr, $prependRows, $normalRows, $list, $startindex,last_query());
$torrentRep = new \App\Repositories\TorrentRepository();
$url = get_protocol_prefix().$BASEURL;
$year = substr($datefounded, 0, 4);