diff --git a/crmeb/app/services/system/SystemCrudServices.php b/crmeb/app/services/system/SystemCrudServices.php index 888792843..fbd28a596 100644 --- a/crmeb/app/services/system/SystemCrudServices.php +++ b/crmeb/app/services/system/SystemCrudServices.php @@ -843,6 +843,7 @@ class SystemCrudServices extends BaseServices $dao = app()->make(Dao::class); $dao->setFilePathName($filePath['dao'] ?? '')->setbasePath($basePath)->handle($tableName, [ 'usePath' => $model->getUsePath(), + 'modelName' => $options['modelName'] ?? '', ]); //生成service $service = app()->make(Service::class); diff --git a/crmeb/crmeb/services/crud/Make.php b/crmeb/crmeb/services/crud/Make.php index d1380fe76..2156caa26 100644 --- a/crmeb/crmeb/services/crud/Make.php +++ b/crmeb/crmeb/services/crud/Make.php @@ -238,6 +238,9 @@ abstract class Make if (isset($this->value['use-php']) && !empty($options['usePath'])) { $this->value['use-php'] = "use " . str_replace('/', '\\', $options['usePath']) . ";\n"; } + if (isset($this->value['modelName']) && !$this->value['modelName'] && !empty($options['modelName'])) { + $this->value['modelName'] = $options['modelName']; + } $contentStr = str_replace($this->var, $this->value, $content); $filePath = $this->getFilePathName($path, $this->value['nameCamel']);