*Fixbug_sunjun_17344
This commit is contained in:
+16
-19
@@ -837,23 +837,6 @@ class productModel extends model
|
||||
$maxOrder = $maxOrder ? $maxOrder : 0;
|
||||
|
||||
$lines = array();
|
||||
foreach($data->modules as $id => $name)
|
||||
{
|
||||
if(empty($name)) continue;
|
||||
$productLine = new stdclass();
|
||||
$productLine->module = $name;
|
||||
$productLine->program = $data->programs[$id];
|
||||
if(in_array($productLine, $lines))
|
||||
{
|
||||
dao::$errors[] = sprintf($this->lang->product->nameIsDuplicate, $productLine->module);
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
$lines[] = $productLine;
|
||||
}
|
||||
}
|
||||
|
||||
foreach($data->modules as $id => $name)
|
||||
{
|
||||
if(empty($name)) continue;
|
||||
@@ -863,8 +846,22 @@ class productModel extends model
|
||||
return false;
|
||||
}
|
||||
|
||||
$line->name = strip_tags(trim($name));
|
||||
$line->root = $data->programs[$id];
|
||||
$programID = $data->programs[$id];
|
||||
if(!isset($lines[$programID])) $lines[$programID] = array();
|
||||
if(in_array($name, $lines[$programID]))
|
||||
{
|
||||
dao::$errors[] = sprintf($this->lang->product->nameIsDuplicate, $name);
|
||||
return false;
|
||||
}
|
||||
$lines[$programID][] = $name;
|
||||
}
|
||||
|
||||
foreach($data->modules as $id => $name)
|
||||
{
|
||||
if(empty($name)) continue;
|
||||
|
||||
$line->name = strip_tags(trim($name));
|
||||
$line->root = $data->programs[$id];
|
||||
|
||||
if(is_numeric($id))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user