WorkFlowInstances.php 952 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. namespace App\Model;
  3. use Illuminate\Database\Eloquent\Model;
  4. //流程实例表
  5. class WorkFlowInstances extends DataScopeBaseModel
  6. {
  7. protected $guarded = [];
  8. protected $table = "workflow_instances"; //指定表
  9. const CREATED_AT = 'crt_time';
  10. const UPDATED_AT = 'upd_time';
  11. protected $dateFormat = 'U';
  12. public static $field = ['id', 'template_id', 'document_id', 'document_type', 'status', 'crt_id', 'crt_time', 'upd_time'];
  13. const status_one = 'pending';
  14. const status_two = 'processing';
  15. const status_three = 'approved';
  16. const status_four = 'rejected';
  17. /**
  18. * 定义与模板表的关联
  19. */
  20. public function template()
  21. {
  22. // 参数1:关联的模型类名
  23. // 参数2:当前表(instances)中用来关联的字段名
  24. // 参数3:目标表(templates)的主键名
  25. return $this->belongsTo(WorkFlowTemplates::class, 'template_id', 'id');
  26. }
  27. }