37 lines
784 B
PHP
37 lines
784 B
PHP
<?php
|
|
|
|
namespace app\admin\validate;
|
|
|
|
use think\Validate;
|
|
|
|
class UserRelationApply extends Validate
|
|
{
|
|
protected $rule = [
|
|
'uid' => 'require',
|
|
'recived_uid' => 'require',
|
|
'type' => 'require|in:1,2,3',
|
|
'status' => 'in:1,2,3'
|
|
|
|
];
|
|
|
|
/**
|
|
* 定义错误信息
|
|
* 格式:'字段名.规则名' => '错误信息'
|
|
*
|
|
* @var array
|
|
*/
|
|
protected $message = [
|
|
'uid.require' => 'uid必须',
|
|
'recived_uid.require' => 'recived_uid必须',
|
|
'type.require' => '关系类型必须',
|
|
'type.in' => '关系类型非法',
|
|
'status.in' => '状态非法',
|
|
|
|
];
|
|
|
|
protected $scene = [
|
|
'apiAdd' => ['uid', 'recived_uid', 'type', 'status'],
|
|
'apiEdit' => ['status'],
|
|
];
|
|
}
|