$arr = $dsql->GetOne("Select * From `dede_sys_enum` where egroup='$egroup' And (evalue mod 500)=0 order by evalue desc ");
if(!is_array($arr)) $disorder = $evalue = ($issign==1 ? 1 : 500);
else $disorder = $evalue = $arr['disorder'] + ($issign==1 ? 1 : 500);
$dsql->ExecuteNoneQuery("Insert into `dede_sys_enum`(`ename`,`evalue`,`egroup`,`disorder`,`issign`)
values('$ename','$evalue','$egroup','$disorder','$issign'); ");
}
WriteEnumsCache($egroup);
ShowMsg("成功添加枚举分类!".$dsql->GetError(), $ENV_GOBACK_URL);
exit();
}
else
{
$minid = $topvalue;
$maxid = $topvalue + 500;
$enames = explode(',', $ename);
foreach($enames as $ename)
{
$arr = $dsql->GetOne("Select * From `dede_sys_enum` where egroup='$egroup' And evalue>$minid And evalue<$maxid order by evalue desc ");
if(!is_array($arr))
{
$disorder = $evalue = $minid+1;
}
else
{
$disorder = $arr['disorder']+1;
$evalue = $arr['evalue']+1;
}
$dsql->ExecuteNoneQuery("Insert into `dede_sys_enum`(`ename`,`evalue`,`egroup`,`disorder`,`issign`)
values('$ename','$evalue','$egroup','$disorder','$issign'); ");
}
WriteEnumsCache($egroup);
ShowMsg("成功添加枚举分类!", $ENV_GOBACK_URL);
exit();
}
}
然后保存,在系统后台更新系统缓存就可以了的。现在在后台的联动类别管理里面就可以增加二级选择了。