Files
fdesk/app/common/model/SysDictCategory.php
T
mzl92 f5e93f2400 Merge branch 'feature/mzl_dev' into develop
# Conflicts:
#	app/admin/service/SysDictService.php
2025-09-09 13:47:04 +08:00

58 lines
1.1 KiB
PHP

<?php
namespace app\common\model;
use support\Model;
class SysDictCategory extends Model
{
/**
* The connection name for the model.
*
* @var string|null
*/
protected $connection = 'mysql';
/**
* The table associated with the model.
*
* @var string
*/
protected $table = 'sys_dict_category';
/**
* 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', 'category_name', 'sort', 'status', 'created_at', 'updated_at'];
/**
* 不允许自动填充模型字段
*/
protected $guarded = [];
public function dicts()
{
return $this->hasMany(SysDict::class, 'category_id', 'id')
->where('status', 1)
->whereNull('deleted_at')
->orderBy('id', 'asc');
}
}