dedecms织梦数据量达到几十万生成速度很慢的解决方法
发布时间:2020-10-09 | 发布者: 东东工作室 | 浏览次数: 次摘要: 本人5.7 生成 列表页改动include/arc.listview.class.php 1.先设置关闭副栏目(在系统----系统基本参数性能选项里) 2.一般网站不需要栏目交叉交叉所以找到94行注释掉: //获得交叉栏目ID /*if($this-Typ...
本人5.7 生成列表页 改动 include/arc.listview.class.php
1.先设置 关闭副栏目(在系统----系统基本参数—性能选项里)
2.一般网站不需要 栏目交叉 交叉 所以 找到94行注释掉:
/*if($this->TypeLink->TypeInfos['cross']>0 && $this->TypeLink->TypeInfos['ispart']==0)
{
$selquery = '';
if($this->TypeLink->TypeInfos['cross']==1)
{
$selquery = "SELECT id,topid FROM `dede_arctype` WHERE typename LIKE '{$this->Fields['typename']}' AND id<>'{$this->TypeID}' AND topid<>'{$this->TypeID}' ";
}
else
{
$this->Fields['crossid'] = preg_replace('/[^0-9,]/', '', trim($this->Fields['crossid']));
if($this->Fields['crossid']!='')
{
$selquery = "SELECT id,topid FROM `dede_arctype` WHERE id in({$this->Fields['crossid']}) AND id<>{$this->TypeID} AND topid<>{$this->TypeID} ";
}
}
if($selquery!='')
{
$this->dsql->SetQuery($selquery);
$this->dsql->Execute();
while($arr = $this->dsql->GetArray())
{
$this->CrossID .= ($this->CrossID=='' ? $arr['id'] : ','.$arr['id']);
}
}
}*/
3.找到751注释掉:
//获得附加表的相关信息/*$addtable = $this->ChannelUnit->ChannelInfos['addtable'];
if($addtable!="")
{
$addJoin = " LEFT JOIN `$addtable` ON arc.id = ".$addtable.'.aid ';
$addField = '';
$fields = explode(',',$this->ChannelUnit->ChannelInfos['listfields']);
foreach($fields as $k=>$v)
{
$nfields[$v] = $k;
}
if(is_array($this->ChannelUnit->ChannelFields) && !empty($this->ChannelUnit->ChannelFields))
{
foreach($this->ChannelUnit->ChannelFields as $k=>$arr)
{
if(isset($nfields[$k]))
{
if(!empty($arr['rename'])) {
$addField .= ','.$addtable.'.'.$k.' as '.$arr['rename'];
}
else {
$addField .= ','.$addtable.'.'.$k;
}
}
}
}
}
else
{
$addField = '';
$addJoin = '';
}*/
再加上$addtable="";
4.找到815行
/*$query = "SELECT arc.*,tp.typedir,tp.typename,tp.corank,tp.isdefault,tp.defaultname,tp.namerule,tp.namerule2,tp.ispart,tp.moresite,tp.siteurl,tp.sitepath
$addField
FROM `dede_archives` arc LEFT JOIN `dede_arctype` tp ON arc.typeid=tp.id
$addJoin
WHERE arc.id in($idstr) $ordersql ";*/
修改:去掉 $addField
$query = "SELECT arc.*,tp.typedir,tp.typename,tp.corank,tp.isdefault,tp.defaultname,
tp.namerule,tp.namerule2,tp.ispart,tp.moresite,tp.siteurl,tp.sitepath
FROM `dede_archives` arc LEFT JOIN `dede_arctype` tp ON arc.typeid=tp.id
$addJoin
WHERE arc.id in($idstr) $ordersql ";
推荐文章
相关文章