* fix for check module unique.

This commit is contained in:
wangyidong
2016-05-23 09:21:26 +08:00
parent 16f8c28202
commit d17beaf08c
+2 -1
View File
@@ -1419,10 +1419,11 @@ class treeModel extends model
public function checkUnique($rootID, $viewType, $parentModuleID, $modules = array(), $branches = array())
{
if(empty($branches)) $branches = $this->post->branch;
$branches = array_unique($branches);
if($this->isMergeModule($rootID, $viewType)) $viewType .= ',story';
$existsModules = $this->dao->select('id,branch,name')->from(TABLE_MODULE)->where('root')->eq($rootID)->andWhere('type')->in($viewType)->andWhere('parent')->eq($parentModuleID)->fetchAll();
$existsModules = $this->dao->select('id,branch,name')->from(TABLE_MODULE)->where('root')->eq($rootID)->andWhere('type')->in($viewType)->andWhere('parent')->eq($parentModuleID)->andWhere('branch')->in($branches)->fetchAll();
$repeatName = '';
foreach($modules as $id => $name)
{