caipan_shop_admin/app/validate/AppointmentValidate.php

21 lines
656 B
PHP
Executable File

<?php
namespace app\validate;
use think\Validate;
class AppointmentValidate extends Validate
{
protected $rule = [
'type_id|预约分类' => 'require|number|gt:0',
'day|预约日期' => 'require|date',
'period_id|预约时间段' => 'require|number|gt:0',
'user_name|联系人' => 'require|min:2|max:30',
'user_phone|联系电话' => 'require|min:7|max:30',
'remarks|留言信息' => 'max:500',
];
protected $scene = [
// 添加自主预约
'add_appointment' => ['type_id', 'day', 'period_id', 'user_name', 'user_phone', 'remarks'],
];
}