一键生成菜单改进:判断是否有启用软删除(兼容新旧一键生成CRUD)

pull/71/head
pppscn 2018-08-13 13:27:58 +08:00
parent 2b87fa4735
commit a6dd0b0198
1 changed files with 7 additions and 0 deletions

View File

@ -196,6 +196,13 @@ class Menu extends Command
if (in_array('trashed', get_class_methods($model))) { if (in_array('trashed', get_class_methods($model))) {
$withSofeDelete = true; $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) { if (stripos($classComment, "@internal") !== FALSE) {