Your Name преди 3 години
родител
ревизия
12c09582ff
променени са 2 файла, в които са добавени 11 реда и са изтрити 8 реда
  1. 1 1
      tool/clue/database/salepeople.php
  2. 10 7
      tool/clue/lib/Info.php

+ 1 - 1
tool/clue/database/salepeople.php

@@ -13,7 +13,7 @@ return array
     'start' => array
     (
         'insert' => 'clue/lib/info.insertSell',
-        // 'update' => 'clue/lib/info.insertSell',
+        'update' => 'clue/lib/info.insertSell',
     ),
     'end' => array
     (

+ 10 - 7
tool/clue/lib/Info.php

@@ -340,9 +340,16 @@ Class Info
 	}
 	public function insertSell($id,$name,$data) {
 		$group = Dever::param('group',$data);
-		$data = Dever::db('clue/salepeople')->find(array('group'=>$group));
-		if ($data) {
-			Dever::alert('销售员不可重复提交');
+		
+		if ($group) {
+			$res = Dever::db('clue/salepeople')->find(array('group'=>$group));
+			if ($res && isset($id['where_id']) && $id['where_id']){
+				if ($res['id'] !=  $id['where_id']){
+					Dever::alert('销售员不可重复提交');
+				} 
+			} elseif ($res) {
+				Dever::alert('部门已存在');
+			}
 		}
 	}
 	public function updateSell($id,$name,$data)
@@ -356,8 +363,4 @@ Class Info
 			}
 		}
 	}
-	// public function getSalepeople()
-	// {
-	// 	$data = Dever::db('clue/salepeople')->state();
-	// }
 }