From d949c9a83c1527681a2ab378ef5fe58a1c17a04a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Mon, 12 Apr 2021 15:53:05 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Gii/GiiModel.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Gii/GiiModel.php b/Gii/GiiModel.php index 3df3449a..79d21b01 100644 --- a/Gii/GiiModel.php +++ b/Gii/GiiModel.php @@ -67,8 +67,15 @@ namespace ' . $namespace . '; if (!empty($imports)) { $html .= $imports . PHP_EOL; } + + if (!str_contains($imports, 'Annotation\Model\Set')) { + $html .= 'use Annotation\Model\Set' . PHP_EOL; + } + if (!str_contains($imports, 'Annotation\Model\Get')) { + $html .= 'use Annotation\Model\Get' . PHP_EOL; + } } catch (\Throwable $e) { - logger()->addError($e,'throwable'); + logger()->addError($e, 'throwable'); } } @@ -82,6 +89,9 @@ use Exception; use Annotation\Target; use Snowflake\Core\JSON; use Database\Connection; +use Annotation\Model\Get; +use Annotation\Model\Set; +use Annotation\Model\Relation; use Database\ActiveRecord; ' . PHP_EOL; }