From d17beaf08ca0ebbdeb9b723d1def45b17dd0575b Mon Sep 17 00:00:00 2001 From: wangyidong Date: Mon, 23 May 2016 09:21:26 +0800 Subject: [PATCH] * fix for check module unique. --- module/tree/model.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/module/tree/model.php b/module/tree/model.php index 430e4ea517..5499c69aec 100644 --- a/module/tree/model.php +++ b/module/tree/model.php @@ -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) {