feat: add article and production modules
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
<?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');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user