This commit is contained in:
songliang 2022-12-07 12:18:16 +08:00
parent 548c6bd64b
commit a24bfa8fc8
2 changed files with 18 additions and 6 deletions

View File

@ -140,7 +140,14 @@ console.log("season ranking start1");
if (element.score>0) {
sorted.push(element);
sorted.sort(function(a,b) {
return b.score - a.score;
let r = b.score - a.score;
if (r==0) {
r = a.score_modifytime - b.score_modifytime;
}
if (r==0) {
r = a.idx - b.idx;
}
return r;
});
}
}

View File

@ -563,16 +563,21 @@ class MarketController extends BaseController {
$total = count($rows);
$page_end = $start + $page_size;
if ($page_end > $total)
if ($page_end > $total) {
$page_end = $total;
$start = $total-1;
$start = intval($start / $page_size) * $page_size;
if ($start<0) $start = 0;
}
$nfts = array();
for ($x = $start; $x < $page_end; $x++) {
$row = $rows[$x];
$nftDb = Nft::getNft($row['token_id']);
// if (!$nftDb) {
// myself()->_rspErr(1, 'nft not exists');
// return;
// }
if (!$nftDb) {
myself()->_rspErr(1, 'nft not exists');
return;
}
$nft = Nft::toDto($nftDb);
$t = $row['token_type'];