| 1234567891011121314151617181920212223242526272829303132 |
- <?php
- namespace App\Model;
- use Illuminate\Database\Eloquent\Model;
- //流程实例表
- class WorkFlowInstances extends DataScopeBaseModel
- {
- protected $guarded = [];
- protected $table = "workflow_instances"; //指定表
- const CREATED_AT = 'crt_time';
- const UPDATED_AT = 'upd_time';
- protected $dateFormat = 'U';
- public static $field = ['id', 'template_id', 'document_id', 'document_type', 'status', 'crt_id', 'crt_time', 'upd_time'];
- const status_one = 'pending';
- const status_two = 'processing';
- const status_three = 'approved';
- const status_four = 'rejected';
- /**
- * 定义与模板表的关联
- */
- public function template()
- {
- // 参数1:关联的模型类名
- // 参数2:当前表(instances)中用来关联的字段名
- // 参数3:目标表(templates)的主键名
- return $this->belongsTo(WorkFlowTemplates::class, 'template_id', 'id');
- }
- }
|