fix:修复Laravel丢弃的接口
This commit is contained in:
parent
70a47e35ec
commit
439d897038
@ -92,14 +92,13 @@ class Schemas extends CatchModel
|
||||
|
||||
$columns = [];
|
||||
|
||||
foreach (getTableColumns($schema->name) as $columnString) {
|
||||
$column = DB::connection()->getDoctrineColumn(DB::connection()->getTablePrefix().$schema->name, $columnString);
|
||||
foreach (\Illuminate\Support\Facades\Schema::getColumns($schema->name) as $column) {
|
||||
$columns[] = [
|
||||
'name' => $column->getName(),
|
||||
'type' => $column->getType()->getName(),
|
||||
'nullable' => ! $column->getNotnull(),
|
||||
'default' => $column->getDefault(),
|
||||
'comment' => $column->getComment()
|
||||
'name' => $column['name'],
|
||||
'type' => $column['type_name'],
|
||||
'nullable' => $column['nullable'],
|
||||
'default' => $column['default'],
|
||||
'comment' => $column['comment'],
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -130,6 +130,7 @@ use Catch\Traits\DB\BaseOperate;
|
||||
use Catch\Traits\DB\ScopeTrait;
|
||||
use Catch\Traits\DB\Trans;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Catch\Traits\DB\WithAttributes;
|
||||
Text;
|
||||
} else {
|
||||
return <<<Text
|
||||
@ -145,7 +146,7 @@ Text;
|
||||
*/
|
||||
protected function getTraits(): string
|
||||
{
|
||||
return $this->softDelete ? '' : 'use BaseOperate, Trans, ScopeTrait;';
|
||||
return $this->softDelete ? '' : 'use WithAttributes, BaseOperate, Trans, ScopeTrait;';
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user