Files
zyt/server/app/adminapi/validate/tcm/RevisitDueValidate.php
T
2026-10-15 11:03:54 +08:00

70 lines
2.2 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
declare(strict_types=1);
namespace app\adminapi\validate\tcm;
use app\common\validate\BaseValidate;
/**
* 复诊到期弹窗写接口验证(snooze / snoozeAll / contact / close)与主管视图流水(logs)
*
* 归属(本人 / 超管 / 数据范围)与业务约束(承诺日范围、周期状态)在 RevisitDueLogic 内校验,此处只做入参形态。
*
* @package app\adminapi\validate\tcm
*/
class RevisitDueValidate extends BaseValidate
{
protected $rule = [
'id' => 'require|number|gt:0',
'ids' => 'require|array',
'due_id' => 'require|number|gt:0',
'promised_date' => 'require|dateFormat:Y-m-d',
'reason' => 'require|in:lost,other',
'remark' => 'max:200',
];
protected $message = [
'id.require' => '参数缺失',
'id.number' => '提醒 id 非法',
'id.gt' => '提醒 id 非法',
'due_id.require' => '参数缺失 due_id',
'due_id.number' => '提醒 id 非法',
'due_id.gt' => '提醒 id 非法',
'ids.require' => '请选择要延迟的提醒',
'ids.array' => '提醒 id 列表格式错误',
'promised_date.require' => '请选择患者承诺复诊日',
'promised_date.dateFormat' => '承诺复诊日格式应为 YYYY-MM-DD',
'reason.require' => '请选择关闭原因',
'reason.in' => '关闭原因只能是 lost 或 other',
'remark.require' => '请填写关闭说明',
'remark.max' => '说明不能超过 200 字',
];
public function sceneSnooze()
{
return $this->only(['id']);
}
public function sceneSnoozeAll()
{
return $this->only(['ids']);
}
public function sceneContact()
{
return $this->only(['id', 'promised_date', 'remark']);
}
public function sceneClose()
{
return $this->only(['id', 'reason', 'remark'])
->append('remark', 'require');
}
public function sceneLogs()
{
return $this->only(['due_id']);
}
}