更新
This commit is contained in:
@@ -0,0 +1,69 @@
|
||||
<?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']);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user