LIMIT $limitstart,".$this->PageSize;
这两个数字是用来限制要显示得内容的多少的,上面那条语句目前不能限制多少。因为如果要限制的话就没有这么简单了
select * from (SELECT arc.*,tp.typedir,tp.typename,tp.isdefault,tp.defaultname, tp.namerule,tp.namerule2,tp.ispart,tp.moresite,tp.siteurl,tp.sitepath $addField, 2 as type FROM {$this->maintable} arc LEFT JOIN #@__arctype tp ON arc.typeid=tp.id $addJoin WHERE arc.arcrank > -1 AND channel>-1 AND arc.channel = '1' AND CONCAT(arc.title) REGEXP '关键词一' unionSELECT arc.*,tp.typedir,tp.typename,tp.isdefault,tp.defaultname, tp.namerule,tp.namerule2,tp.ispart,tp.moresite,tp.siteurl,tp.sitepath $addField, 1 as type FROM {$this->maintable} arc LEFT JOIN #@__arctype tp ON arc.typeid=tp.id $addJoin WHERE arc.arcrank > -1 AND channel>-1 AND arc.channel = '1' AND CONCAT(arc.title) REGEXP '关键词二'
) as tmp
order by type, pubdate desc LIMIT $limitstart,".$this->PageSize;
因为没有环境无法执行,可能有点语法错误,如果发现没有结果,你把完整的SQL语句输出来之后手工执行下,看看哪儿有错误