VALUES('{$row['name']}','$evalue','nativeplace','$disorder','0'); ");
$n++;
}
$stypes = array();
foreach($bigtypes as $k=>$v)
{
$query = "SELECT * FROM `zuimoban_area` WHERE reid=$k order by id asc";
$dsql->Execute('me', $query);
$n = 1;
while($row = $dsql->GetArray())
{
$stypes[$row['id']] = $evalue = $disorder = $v + $n;
$dsql->ExecuteNoneQuery("INSERT INTO `zuimoban_sys_enum`(`ename`,`evalue`,`egroup`,`disorder`,`issign`)
VALUES('{$row['name']}','$evalue','nativeplace','$disorder','0'); ");
$n++;
}
}
WriteEnumsCache('nativeplace');
ShowMsg("成功导入所有旧的地区数据!", "stepselect_main.php?egroup=nativeplace");
exit();
}
/*--------------------
function __addenum_save() { }
关于二级枚举的说明,为了节省查询速度,二级枚举是通过特殊算法生成的,原理为
凡是能被 500 整除的都是一级枚举,(500 * n) + 1 < em < 500 * (n+1) 为下级枚举
如:1000 的下级枚举对应的值为 1001,1002,1003...1499
对于 issign=1 的,表示这个类别只有一级枚举,则不受上面的算法限制
------------------------------------------------------------------------
更新算法:
新增二级枚举下添加"-N"自己类别选择,例如:
1001二级枚举下面的3级类目,则为1001-1,1001-2...
这时候需要issign=2
---------------------*/
else if($action=='addenum_save')
{
if(empty($ename) || empty($egroup))
{
Showmsg("类别名称或组名称不能为空!","-1");
exit();
}
if($issign == 1 || $topvalue == 0)
{
$enames = explode(',', $ename);
foreach($enames as $ename)
{