初始化代码
This commit is contained in:
34
application/admin/validate/UserRelation.php
Normal file
34
application/admin/validate/UserRelation.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace app\admin\validate;
|
||||
|
||||
use think\Validate;
|
||||
|
||||
class UserRelation extends Validate
|
||||
{
|
||||
protected $rule = [
|
||||
'uid' => 'require',
|
||||
'recived_uid' => 'require',
|
||||
'type' => 'require|in:1,2,3'
|
||||
|
||||
];
|
||||
|
||||
/**
|
||||
* 定义错误信息
|
||||
* 格式:'字段名.规则名' => '错误信息'
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $message = [
|
||||
'uid.require' => 'uid必须',
|
||||
'recived_uid.require' => 'recived_uid必须',
|
||||
'type.require' => '关系类型必须',
|
||||
'type.in' => '关系类型非法',
|
||||
|
||||
];
|
||||
|
||||
protected $scene = [
|
||||
'apiAdd' => ['uid', 'recived_uid', 'type'],
|
||||
'apiAdd' => ['uid', 'recived_uid', 'type'],
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user