Your Name 3 years ago
parent
commit
8e2ab5da44
2 changed files with 13 additions and 6 deletions
  1. 5 5
      tool/clue/database/salepeople.php
  2. 8 1
      tool/clue/lib/Info.php

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

@@ -10,11 +10,11 @@ return array
     // 'menu' => false,
     // 'auto' => 100000,
     // 'check' => 'group_id',
-    // 'start' => array
-    // (
-    //     'insert' => 'work/lib/appoint.startBranch',
-    //     'update' => 'work/lib/appoint.startBranch',
-    // ),
+    'start' => array
+    (
+        'insert' => 'clue/lib/info.insertSell',
+        'update' => 'clue/lib/info.insertSell',
+    ),
     'end' => array
     (
         'insert' => 'clue/lib/info.updateSell',

+ 8 - 1
tool/clue/lib/Info.php

@@ -338,6 +338,13 @@ Class Info
         }
 		return count($data).$string;
 	}
+	public function insertSell($id,$name,$data) {
+		$group = Dever::param('group',$data);
+		$data = Dever::db('clue/salepeople')->find(array('group'=>$group));
+		if ($data) {
+			Dever::alert('销售员不可重复提交');
+		}
+	}
 	public function updateSell($id,$name,$data)
 	{
 		$group = Dever::param('group',$data);
@@ -345,7 +352,7 @@ Class Info
 			if (isset($group[0]) && $group[0]) {
 				$w['where_id'] = $id;
 				$w['group_id'] = $group[0];
-				Dever::db('clue/salePeople')->update($w);
+				Dever::db('clue/salepeople')->update($w);
 			}
 		}
 	}