作者 Amor

优化 Menu.php getAuthRulePK 方法

@@ -277,12 +277,11 @@ class Menu extends Command @@ -277,12 +277,11 @@ class Menu extends Command
277 protected function getAuthRulePK($name) { 277 protected function getAuthRulePK($name) {
278 if (!empty($name)) 278 if (!empty($name))
279 { 279 {
280 - $PK = $this->model 280 + return $this->model
281 ->where('name', $name) 281 ->where('name', $name)
282 ->value('id'); 282 ->value('id');
283 283
284 } 284 }
285 - return $PK;  
286 } 285 }
287 286
288 } 287 }