织梦联动地区后台显示为数字的真正解决方法,其实官方也有,但是不能直接调用,我把它提取出来单独写个在后台自定义表单

打开 /dede/templets/diy_list.htm 找到 (大约在41行)

else if($fielddata[1]=='addon')
{
  $fields[$field] = "<a href='{$fields[$field]}' target='_blank'><img src='images/channeladd.gif' border='0' /> 其它附件</a>";
}

在下面加入:

else if($fielddata[1]=='stepselect')
{
	$db->Execute('me',"SELECT * FROM `#@_stepselect` WHERE egroup='{$field}'");
	while($arr = $db->GetArray(me))
	{
		$egroup = $arr['egroup'];
	}
	$fields[$field] = Getenums("{$fields[$field]}",$egroup);
}

继续找到:

{/dede:datalist}

在下面加入:

<?php
if (!function_exists('Getenums'))
{
	function Getenums($evalue=0,$egroup)
	{
		if( !isset($GLOBALS['em_'.$egroup.'s']) )
		{
			$cachefile = DEDEDATA.'/enums/'.$egroup.'.php';
			if(!file_exists($cachefile))
			{
				require_once(DEDEINC.'/enums.func.php');
				WriteEnumsCache();
			}
			if(!file_exists($cachefile))
			{
				return '';
			}
			else
			{
				require_once($cachefile);
			}
		}
		if($evalue>=500)
		{
			if($evalue % 500 == 0)
			{
				return (isset($GLOBALS['em_'.$egroup.'s'][$evalue]) ? $GLOBALS['em_'.$egroup.'s'][$evalue] : '');
			}
			else if (preg_match("#([0-9]{1,})\.([0-9]{1,})#", $evalue, $matchs))
			{
				$esonvalue = $matchs[1];
				$etopvalue = $esonvalue - ($esonvalue % 500);
				$esecvalue = $evalue;
				$GLOBALS['em_'.$egroup.'s'][$etopvalue] = empty($GLOBALS['em_'.$egroup.'s'][$etopvalue])? '' 
														 : $GLOBALS['em_'.$egroup.'s'][$etopvalue];
				$GLOBALS['em_'.$egroup.'s'][$esonvalue] = empty($GLOBALS['em_'.$egroup.'s'][$esonvalue])? '' 
														 : $GLOBALS['em_'.$egroup.'s'][$esonvalue];
				$GLOBALS['em_'.$egroup.'s'][$esecvalue] = empty($GLOBALS['em_'.$egroup.'s'][$esecvalue])? '' 
														 : $GLOBALS['em_'.$egroup.'s'][$esecvalue];
				return $GLOBALS['em_'.$egroup.'s'][$etopvalue].' -- '.$GLOBALS['em_'.$egroup.'s'][$esonvalue].' -- '.$GLOBALS['em_'.$egroup.'s'][$esecvalue];
			}
			else
			{
				$elimit = $evalue % 500;
				$erevalue = $evalue - $elimit;
				$GLOBALS['em_'.$egroup.'s'][$erevalue] = empty($GLOBALS['em_'.$egroup.'s'][$erevalue])? '' 
														 : $GLOBALS['em_'.$egroup.'s'][$erevalue];
				$GLOBALS['em_'.$egroup.'s'][$evalue] = empty($GLOBALS['em_'.$egroup.'s'][$evalue])? '' 
														 : $GLOBALS['em_'.$egroup.'s'][$evalue];
				return $GLOBALS['em_'.$egroup.'s'][$erevalue].' -- '.$GLOBALS['em_'.$egroup.'s'][$evalue];
			}
		}
	}
}
?>

修改完毕.