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
+1 -1
View File
@@ -1,6 +1,6 @@
<?php <?php
defined('VERSION_NUMBER') || define('VERSION_NUMBER', '1.8.0'); 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('IN_TRACKER') || define('IN_TRACKER', false);
defined('PROJECTNAME') || define("PROJECTNAME","NexusPHP"); defined('PROJECTNAME') || define("PROJECTNAME","NexusPHP");
defined('NEXUSPHPURL') || define("NEXUSPHPURL","https://nexusphp.org"); defined('NEXUSPHPURL') || define("NEXUSPHPURL","https://nexusphp.org");
+3 -2
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"; $query = "SELECT $fieldStr FROM torrents LEFT JOIN categories ON category = categories.id $normalWhere ORDER BY $sort LIMIT $limit";
$normalRows = \Nexus\Database\NexusDB::select($query); $normalRows = \Nexus\Database\NexusDB::select($query);
} }
if (!empty($prependIdArr) && $startindex > 0) { if (!empty($prependIdArr) && $startindex == 0) {
$prependIdStr = implode(',', $prependIdArr); $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)"); $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(); $torrentRep = new \App\Repositories\TorrentRepository();
$url = get_protocol_prefix().$BASEURL; $url = get_protocol_prefix().$BASEURL;
$year = substr($datefounded, 0, 4); $year = substr($datefounded, 0, 4);