fix:修复 Laravel11 获取表栏目
This commit is contained in:
parent
7362bdd70f
commit
898ce1305d
@ -6,8 +6,8 @@ use Catch\Base\CatchModel;
|
|||||||
use Catch\Enums\Status;
|
use Catch\Enums\Status;
|
||||||
use Exception;
|
use Exception;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
use Illuminate\Support\Facades\DB;
|
|
||||||
use Modules\Develop\Support\Generate\Create\Schema;
|
use Modules\Develop\Support\Generate\Create\Schema;
|
||||||
|
use Illuminate\Support\Facades\Schema as SchemaFacade;
|
||||||
|
|
||||||
class Schemas extends CatchModel
|
class Schemas extends CatchModel
|
||||||
{
|
{
|
||||||
@ -90,16 +90,13 @@ class Schemas extends CatchModel
|
|||||||
{
|
{
|
||||||
$schema = parent::firstBy($id);
|
$schema = parent::firstBy($id);
|
||||||
|
|
||||||
$columns = [];
|
foreach (SchemaFacade::getColumns($schema->name) as $column) {
|
||||||
|
|
||||||
foreach (getTableColumns($schema->name) as $columnString) {
|
|
||||||
$column = DB::connection()->getDoctrineColumn(DB::connection()->getTablePrefix().$schema->name, $columnString);
|
|
||||||
$columns[] = [
|
$columns[] = [
|
||||||
'name' => $column->getName(),
|
'name' => $column['name'],
|
||||||
'type' => $column->getType()->getName(),
|
'type' => $column['type_name'],
|
||||||
'nullable' => ! $column->getNotnull(),
|
'nullable' => $column['nullable'],
|
||||||
'default' => $column->getDefault(),
|
'default' => $column['default'],
|
||||||
'comment' => $column->getComment()
|
'comment' => $column['comment'],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user