39 lines
1.3 KiB
PHP
39 lines
1.3 KiB
PHP
<?php
|
|||
|
|
|
||
|
|
declare(strict_types=1);
|
||
|
|
|
||
|
|
namespace app\adminapi\validate\system;
|
||
|
|
|
||
|
|
use core\base\BaseValidate;
|
||
|
|
|
||
|
|
class FeedbackValidate extends BaseValidate
|
||
|
|
{
|
||
|
|
protected array $rule = [
|
||
|
|
'id' => 'require',
|
||
|
|
'type' => 'require|in:bug,suggestion,correction',
|
||
|
|
'content' => 'require|max:2000',
|
||
|
|
'contact' => 'max:100',
|
||
|
|
'images' => 'array',
|
||
|
|
'source' => 'require|in:app,web',
|
||
|
|
'reply_content' => 'max:2000',
|
||
|
|
];
|
||
|
|
|
||
|
|
protected array $message = [
|
||
|
|
'type.require' => '请选择反馈类型',
|
||
|
|
'type.in' => '反馈类型不正确',
|
||
|
|
'content.require' => '请填写问题描述',
|
||
|
|
'content.max' => '问题描述不能超过2000个字符',
|
||
|
|
'contact.max' => '联系方式不能超过100个字符',
|
||
|
|
'images.array' => '截图附件格式不正确',
|
||
|
|
'source.require' => '请选择反馈来源',
|
||
|
|
'source.in' => '反馈来源不正确',
|
||
|
|
'reply_content.max' => '回复内容不能超过2000个字符',
|
||
|
|
];
|
||
|
|
|
||
|
|
protected array $scene = [
|
||
|
|
'store' => ['type', 'content', 'contact', 'images', 'source'],
|
||
|
|
'update' => ['id', 'type', 'content', 'contact', 'images', 'source'],
|
||
|
|
'reply' => ['id', 'reply_content'],
|
||
|
|
];
|
||
|
|
}
|