You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
56 lines
1.2 KiB
56 lines
1.2 KiB
<?php
|
|
declare(strict_types=1);
|
|
|
|
namespace app\model\school_approval;
|
|
|
|
use core\base\BaseModel;
|
|
|
|
/**
|
|
* 审批历史模型
|
|
* Class SchoolApprovalHistory
|
|
* @package app\model\school_approval
|
|
*/
|
|
class SchoolApprovalHistory extends BaseModel
|
|
{
|
|
/**
|
|
* 数据表主键
|
|
* @var string
|
|
*/
|
|
protected $pk = 'id';
|
|
|
|
/**
|
|
* 模型名称
|
|
* @var string
|
|
*/
|
|
protected $name = 'approval_history';
|
|
|
|
// 审批动作常量
|
|
const ACTION_APPROVE = 'approve';
|
|
const ACTION_REJECT = 'reject';
|
|
const ACTION_FORWARD = 'forward';
|
|
const ACTION_CANCEL = 'cancel';
|
|
|
|
// 审批状态常量
|
|
const STATUS_APPROVED = 'approved';
|
|
const STATUS_REJECTED = 'rejected';
|
|
const STATUS_FORWARDED = 'forwarded';
|
|
const STATUS_CANCELLED = 'cancelled';
|
|
|
|
/**
|
|
* 关联审批流程
|
|
* @return \think\model\relation\BelongsTo
|
|
*/
|
|
public function approvalProcess()
|
|
{
|
|
return $this->belongsTo(SchoolApprovalProcess::class, 'process_id', 'id');
|
|
}
|
|
|
|
/**
|
|
* 关联参与人(人员表)
|
|
* @return \think\model\relation\BelongsTo
|
|
*/
|
|
public function participant()
|
|
{
|
|
return $this->belongsTo('app\model\personnel\Personnel', 'participant_id', 'id');
|
|
}
|
|
}
|