Browse Source

调整

adminstyle
叙述、别离 2 days ago
parent
commit
56eeb2ceda
2 changed files with 8 additions and 8 deletions
  1. +2
    -2
      src/system/archive/listview.class.php
  2. +6
    -6
      src/system/archive/searchview.class.php

+ 2
- 2
src/system/archive/listview.class.php View File

@@ -471,7 +471,7 @@ class ListView
$addJoin = '';
}
//如果不用默认的sortrank或id排序,使用联合查询数据量大时非常缓慢
if (preg_match('/hot|click|lastpost|rand/', $orderby)) {
if (preg_match('/senddate|pubdate|hot|click|lastpost|rand/', $orderby)) {
$query = "SELECT arc.*,tp.typedir,tp.typename,tp.isdefault,tp.defaultname,tp.namerule,tp.namerule2,tp.ispart,tp.moresite,tp.siteurl,tp.sitepath,mb.uname,mb.face,mb.userid $addField FROM `#@__archives` arc LEFT JOIN `#@__arctype` tp ON arc.typeid=tp.id LEFT JOIN `#@__member` mb ON arc.mid=mb.mid $addJoin WHERE {$this->addSql} $filtersql $ordersql LIMIT $limitstart,$row";
}
//普通情况先从arctiny表查出id,然后按id查询速度非常快
@@ -893,7 +893,7 @@ class ListView
$addJoin = '';
}
//如果不用默认的sortrank或id排序,使用联合查询数据量大时非常缓慢
if (preg_match('/hot|click|lastpost|rand/', $orderby)) {
if (preg_match('/senddate|pubdate|hot|click|lastpost|rand/', $orderby)) {
$query = "SELECT arc.*,tp.typedir,tp.typename,tp.isdefault,tp.defaultname,tp.namerule,tp.namerule2,tp.ispart,tp.moresite,tp.siteurl,tp.sitepath,mb.uname,mb.face,mb.userid $addField FROM `#@__archives` arc LEFT JOIN `#@__arctype` tp ON arc.typeid=tp.id LEFT JOIN `#@__member` mb ON arc.mid=mb.mid $addJoin WHERE {$this->addSql} $filtersql $ordersql LIMIT $limitstart,$row";
}
//普通情况先从arctiny表查出id,然后按di查询速度非常快


+ 6
- 6
src/system/archive/searchview.class.php View File

@@ -512,19 +512,19 @@ class SearchView
$ordersql = '';
if ($this->ChannelType < 0 || $this->ChannelTypeid < 0) {
if ($orderby == "id") {
$ordersql = "ORDER BY arc.aid desc";
$ordersql = "ORDER BY arc.aid DESC";
} else {
$ordersql = "ORDER BY arc.senddate desc";
$ordersql = "ORDER BY arc.senddate DESC";
}
} else {
if ($orderby == "senddate") {
$ordersql = " ORDER BY arc.senddate desc";
$ordersql = " ORDER BY arc.senddate DESC";
} else if ($orderby == "pubdate") {
$ordersql = " ORDER BY arc.pubdate desc";
$ordersql = " ORDER BY arc.pubdate DESC";
} else if ($orderby == "id") {
$ordersql = " ORDER BY arc.id desc";
$ordersql = " ORDER BY arc.id DESC";
} else {
$ordersql = " ORDER BY arc.sortrank desc";
$ordersql = " ORDER BY arc.sortrank DESC";
}
}
//搜索


Loading…
Cancel
Save