|
@@ -64,7 +64,13 @@ class School extends Controller
|
|
|
if($this->request->isGet()) {
|
|
|
|
|
|
}elseif ($this->request->isPost()){
|
|
|
-
|
|
|
+ if (isset($data['id']) && $data['id'] > 0) {
|
|
|
+ $is_set = $this->app->db->name('school2')->where('username',$data['username'])->where('id','<>',$data['id'])->find();
|
|
|
+ if($is_set){
|
|
|
+ $this->error('不能设置重复的账号');
|
|
|
+ }
|
|
|
+ $data['password'] = md5($data['username']);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
/**
|