Files
fdesk/app/common/model/InvRequisition.php
T

63 lines
1.4 KiB
PHP
Raw Normal View History

2025-12-05 09:22:53 +00:00
<?php
namespace app\common\model;
use support\Model;
class InvRequisition extends Model
{
/**
* The connection name for the model.
*
* @var string|null
*/
protected $connection = 'mysql';
/**
* The table associated with the model.
*
* @var string
*/
protected $table = 'inv_requisition';
/**
* The primary key associated with the table.
*
* @var string
*/
protected $primaryKey = 'id';
/**
* Indicates if the model should be timestamped.
*
* @var bool
*/
public $timestamps = true;
protected $dateFormat = 'U';
/**
* 允许自动填充模型字段
*/
protected $fillable = ['id', 'order_no', 'applicant_company_id', 'dept_id', 'applicant_id', 'applicant_name', 'leader_id', 'manager_id', 'borrow_reason', 'use_start_date', 'use_end_date', 'status', 'is_returned', 'remark', 'created_at', 'updated_at'];
/**
* 不允许自动填充模型字段
*/
protected $guarded = [];
const STATUS_DRAFT = 0; // 草稿
const STATUS_LEADER = 10; // 待直属上级审批
const STATUS_MANAGE = 20; // 待管理员审批
const STATUS_APPROVED = 30; // 已通过
const STATUS_REJECTEDT = 40; // 已驳回
const STATUS_CANCELED = 50; // 已取消
2026-02-06 13:04:51 +08:00
public function approval()
{
return $this->hasMany('app\common\model\InvRequisitionApprove',
'requisition_id', 'id');
}
2025-12-05 09:22:53 +00:00
}