mirror of https://gitee.com/karson/fastadmin.git
一键生成菜单改进:判断是否有启用软删除(兼容新旧一键生成CRUD)
parent
2b87fa4735
commit
a6dd0b0198
|
|
@ -196,6 +196,13 @@ class Menu extends Command
|
|||
if (in_array('trashed', get_class_methods($model))) {
|
||||
$withSofeDelete = true;
|
||||
}
|
||||
} else {
|
||||
preg_match_all("/\\\$this\->model\s*=\s*new\s+([a-zA-Z\\\]+);/", $classContent, $matches);
|
||||
\think\Request::instance()->module('admin');
|
||||
$model = new $matches[1][0];
|
||||
if (in_array('trashed', get_class_methods($model))) {
|
||||
$withSofeDelete = true;
|
||||
}
|
||||
}
|
||||
//忽略的类
|
||||
if (stripos($classComment, "@internal") !== FALSE) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue