初始化项目

This commit is contained in:
2026-02-08 22:38:13 +08:00
commit 334d2c6312
201 changed files with 32724 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
<?php
namespace App\Models\System;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\SoftDeletes;
class Dictionary extends Model
{
use SoftDeletes;
protected $table = 'system_dictionaries';
protected $fillable = [
'name',
'code',
'description',
'status',
'sort',
];
protected $casts = [
'status' => 'boolean',
];
public function items(): HasMany
{
return $this->hasMany(DictionaryItem::class, 'dictionary_id')->orderBy('sort');
}
public function activeItems(): HasMany
{
return $this->hasMany(DictionaryItem::class, 'dictionary_id')
->where('status', true)
->orderBy('sort');
}
}