59 lines
1.1 KiB
PHP
59 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace app\common\model;
|
|
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
use support\Model;
|
|
|
|
class SysDict extends Model
|
|
{
|
|
use SoftDeletes;
|
|
|
|
/**
|
|
* The connection name for the model.
|
|
*
|
|
* @var string|null
|
|
*/
|
|
protected $connection = 'mysql';
|
|
|
|
/**
|
|
* The table associated with the model.
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $table = 'sys_dict';
|
|
|
|
/**
|
|
* The primary key associated with the table.
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $primaryKey = 'id';
|
|
|
|
/**
|
|
* Indicates if the model should be timestamped.
|
|
*
|
|
* @var bool
|
|
*/
|
|
public $timestamps = true;
|
|
|
|
|
|
protected $dateFormat = 'U';
|
|
|
|
/**
|
|
* 允许自动填充模型字段
|
|
*/
|
|
protected $fillable = ['id', 'dict_name', 'dict_code', 'description', 'status', 'created_at', 'updated_at', 'deleted_at'];
|
|
|
|
/**
|
|
* 不允许自动填充模型字段
|
|
*/
|
|
protected $guarded = [];
|
|
|
|
|
|
// 定义与 SysDictItem 的一对多关系
|
|
public function sysDictItem()
|
|
{
|
|
return $this->hasMany(SysDictItem::class, 'dict_id', 'id');
|
|
}
|
|
} |