作者 lyh

gx

@@ -149,11 +149,9 @@ class UserLogic extends BaseLogic @@ -149,11 +149,9 @@ class UserLogic extends BaseLogic
149 { 149 {
150 foreach ($this->param['id'] as $id){ 150 foreach ($this->param['id'] as $id){
151 $info = $this->model->read(['id'=>$id],['id','role_id']); 151 $info = $this->model->read(['id'=>$id],['id','role_id']);
152 - @file_put_contents(storage_path('logs/lyh_error.log'), var_export($info['role_id'], true) . PHP_EOL, FILE_APPEND);  
153 if($info['role_id'] == 0) { 152 if($info['role_id'] == 0) {
154 //查看当前项目是否有其他的超级管理员 153 //查看当前项目是否有其他的超级管理员
155 - $roleInfo = $this->model->read(['id' => ['!=', $id], 'role_id' => 0]);  
156 - @file_put_contents(storage_path('logs/lyh_error.log'), var_export($roleInfo, true) . PHP_EOL, FILE_APPEND); 154 + $roleInfo = $this->model->read(['id' => ['!=', $id], 'role_id' => 0,'project_id'=>$info['project_id']]);
157 if ($roleInfo === false) { 155 if ($roleInfo === false) {
158 $this->fail('唯一超级管理员,禁止删除'); 156 $this->fail('唯一超级管理员,禁止删除');
159 } 157 }