1if($keyword != '')
01//获得附加表的相关信息02$addField = "";03$addJoin = "";04if(is_object($refObj->ChannelUnit))05{06 $addtable = $refObj->ChannelUnit->ChannelInfos['addtable'];07 if($addtable!="")08 {09 $addJoin = " LEFT JOIN $addtable ON arc.id = ".$addtable.".aid ";10 $addField = "";11 $fields = explode(",",$refObj->ChannelUnit->ChannelInfos['listfields']);12 foreach($fields as $k=>$v)13 {14 $nfields[$v] = $k;15 }16 foreach($refObj->ChannelUnit->ChannelFields as $k=>$arr)17 {18 if(isset($nfields[$k]))19 {20 if(!empty($arr['rename']))21 {22 $addField .= ",".$addtable.".".$k." as ".$arr['rename'];23 }24 else25 {26 $addField .= ",".$addtable.".".$k;27 }28 }29 }30 }31}
继续搜索1tp.sitepath
改成1tp.sitepath $addField
有2处,都要修改,然后继续搜索1arc.typeid=tp.id
改成1arc.typeid=tp.id $addJoin
有2处,都要需改 模板中dede:likearticle调用自定义字段标签写法1{dede:likearticle row='10' col='' titlelen='100' infolen='200'}2<a href="[field:arcurl/]">[field:title/]</a>3<p>价格:¥[field:jiage/]</p>4{/dede:likearticle}
新闻热点
疑难解答