Merge pull request #17 from logdd/patch-1

使用当前模型进行表结构查询
This commit is contained in:
walkor 2023-02-27 08:50:49 +08:00 committed by GitHub
commit b923963f44
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -274,7 +274,7 @@ class Crud extends Base
protected function inputFilter(array $data): array
{
$table = config('plugin.admin.database.connections.mysql.prefix') . $this->model->getTable();
$allow_column = Util::db()->select("desc `$table`");
$allow_column = $this->model->getConnection()->select("desc `$table`");
if (!$allow_column) {
throw new BusinessException('表不存在', 2);
}