//获得附加表的相关信息
$addField = "";
$addJoin = "";
if(is_object($refObj->ChannelUnit))
{
$addtable = $refObj->ChannelUnit->ChannelInfos['addtable'];
if($addtable!="")
{
$addJoin = " LEFT JOIN $addtable ON arc.id = ".$addtable.".aid ";
$addField = "";
$fields = explode(",",$refObj->ChannelUnit->ChannelInfos['listfields']);
foreach($fields as $k=>$v)
{
$nfields[$v] = $k;
}
foreach($refObj->ChannelUnit->ChannelFields as $k=>$arr)
{
if(isset($nfields[$k]))
{
if(!empty($arr['rename']))
{
$addField .= ",".$addtable.".".$k." as ".$arr['rename'];
}
else
{
$addField .= ",".$addtable.".".$k;
}
}
}
}
}
|