fix:修复Laravel丢弃的接口

This commit is contained in:
JaguarJack 2024-03-14 12:17:32 +08:00
parent 70a47e35ec
commit 439d897038
2 changed files with 8 additions and 8 deletions

View File

@ -92,14 +92,13 @@ class Schemas extends CatchModel
$columns = []; $columns = [];
foreach (getTableColumns($schema->name) as $columnString) { foreach (\Illuminate\Support\Facades\Schema::getColumns($schema->name) as $column) {
$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'],
]; ];
} }

View File

@ -130,6 +130,7 @@ use Catch\Traits\DB\BaseOperate;
use Catch\Traits\DB\ScopeTrait; use Catch\Traits\DB\ScopeTrait;
use Catch\Traits\DB\Trans; use Catch\Traits\DB\Trans;
use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Model;
use Catch\Traits\DB\WithAttributes;
Text; Text;
} else { } else {
return <<<Text return <<<Text
@ -145,7 +146,7 @@ Text;
*/ */
protected function getTraits(): string protected function getTraits(): string
{ {
return $this->softDelete ? '' : 'use BaseOperate, Trans, ScopeTrait;'; return $this->softDelete ? '' : 'use WithAttributes, BaseOperate, Trans, ScopeTrait;';
} }
/** /**