feat: 增强管理员权限管理,添加 RBAC 支持,更新 AdminUser 模型以处理角色和权限,更新登录接口返回权限信息,扩展数据库填充器以同步角色权限
This commit is contained in:
45
app/Models/ReconcileJob.php
Normal file
45
app/Models/ReconcileJob.php
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
|
||||
class ReconcileJob extends Model
|
||||
{
|
||||
protected $table = 'reconcile_jobs';
|
||||
|
||||
protected $fillable = [
|
||||
'job_no',
|
||||
'admin_user_id',
|
||||
'reconcile_type',
|
||||
'status',
|
||||
'period_start',
|
||||
'period_end',
|
||||
'summary_json',
|
||||
'finished_at',
|
||||
];
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'period_start' => 'datetime',
|
||||
'period_end' => 'datetime',
|
||||
'summary_json' => 'array',
|
||||
'finished_at' => 'datetime',
|
||||
];
|
||||
}
|
||||
|
||||
/** @return BelongsTo<AdminUser, ReconcileJob> */
|
||||
public function adminUser(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(AdminUser::class, 'admin_user_id');
|
||||
}
|
||||
|
||||
/** @return HasMany<ReconcileItem, ReconcileJob> */
|
||||
public function items(): HasMany
|
||||
{
|
||||
return $this->hasMany(ReconcileItem::class, 'reconcile_job_id');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user