Files
MrleeAdmin/backend/plugin/produce/app/model/StepRelation.php
T

52 lines
1.1 KiB
PHP
Raw Normal View History

2026-08-31 13:16:46 +08:00
<?php
declare(strict_types=1);
namespace plugin\produce\app\model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class StepRelation extends BaseModel
{
protected $table = 'produce_step_relation';
protected $fillable = [
'id',
'from_step_id',
'to_step_id',
'relation_type',
'flow_condition',
'priority',
'description',
'sort',
'status',
'created_by',
'updated_by',
'created_at',
'updated_at',
'deleted_at',
];
protected $casts = [
'from_step_id' => 'integer',
'to_step_id' => 'integer',
'flow_condition' => 'array',
'priority' => 'integer',
'sort' => 'integer',
'status' => 'integer',
'created_at' => 'integer',
'updated_at' => 'integer',
'deleted_at' => 'integer',
];
public function fromStep(): BelongsTo
{
return $this->belongsTo(ProcessStep::class, 'from_step_id', 'id');
}
public function toStep(): BelongsTo
{
return $this->belongsTo(ProcessStep::class, 'to_step_id', 'id');
}
}