- 新增3个migration(9张表): office(6表)/report(1表)/kb(2表) - 新增9个Model + 9个Controller - 新增43条API路由(总计305条) - 新增3个前端API模块 + 10个管理页面 - 迁移运行通过, vite build验证通过
36 lines
752 B
PHP
36 lines
752 B
PHP
<?php
|
|
|
|
namespace App\Models\Office;
|
|
|
|
use App\Models\User;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
class ApprovalNode extends Model
|
|
{
|
|
const UPDATED_AT = null;
|
|
|
|
protected $fillable = [
|
|
'approval_id', 'node_order', 'approver_id', 'action', 'comment', 'acted_at',
|
|
];
|
|
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'node_order' => 'integer',
|
|
'action' => 'integer',
|
|
'acted_at' => 'datetime',
|
|
];
|
|
}
|
|
|
|
public function approval(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Approval::class);
|
|
}
|
|
|
|
public function approver(): BelongsTo
|
|
{
|
|
return $this->belongsTo(User::class, 'approver_id');
|
|
}
|
|
}
|