fixed:模型name属性多加了表前缀

This commit is contained in:
JaguarJack
2020-12-01 17:55:36 +08:00
parent 94c430f491
commit 35445f37e1
2 changed files with 16 additions and 1 deletions

View File

@@ -11,6 +11,7 @@ use catcher\generate\build\classes\Uses;
use catcher\generate\build\types\Arr;
use catcher\traits\db\BaseOptionsTrait;
use catcher\traits\db\ScopeTrait;
use catcher\Utils;
use think\facade\Db;
use think\helper\Str;
@@ -80,7 +81,9 @@ class Model extends Factory
}
$class->addProperty(
(new Property('name'))->default($table)->docComment('// 表名')
(new Property('name'))->default(
Utils::tableWithoutPrefix($table)
)->docComment('// 表名')
);
$class->when($this->hasTableExists($table), function ($class) use ($table){