使用当前模型进行表结构查询

This commit is contained in:
logdd 2023-02-27 00:11:21 +08:00 committed by GitHub
parent 374d2fe59c
commit 1a37474eba
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);
}