89 lines
1.7 KiB
PHP
89 lines
1.7 KiB
PHP
<?php
|
|
namespace app\adminapi\validate\user;
|
|
|
|
|
|
use app\common\validate\BaseValidate;
|
|
|
|
|
|
/**
|
|
* 分组规则验证器
|
|
* Class UserGroupRuleValidate
|
|
* @package app\adminapi\validate\user
|
|
*/
|
|
class UserGroupRuleValidate extends BaseValidate
|
|
{
|
|
|
|
/**
|
|
* 设置校验规则
|
|
* @var string[]
|
|
*/
|
|
protected $rule = [
|
|
'id' => 'require',
|
|
'group_id' => 'require',
|
|
'num' => 'require',
|
|
'money_type' => 'require',
|
|
'commission_type' => 'require',
|
|
];
|
|
|
|
|
|
/**
|
|
* 参数描述
|
|
* @var string[]
|
|
*/
|
|
protected $field = [
|
|
'id' => 'id',
|
|
'group_id' => '分组',
|
|
'num' => '第几单',
|
|
'money_type' => '金额类型1固定值2百分比',
|
|
'commission_type' => '佣金类型1固定值2百分比',
|
|
];
|
|
|
|
|
|
/**
|
|
* @notes 添加场景
|
|
* @return UserGroupRuleValidate
|
|
* @author BD
|
|
* @date 2024/04/25 01:30
|
|
*/
|
|
public function sceneAdd()
|
|
{
|
|
return $this->only(['num','money_type','commission_type']);
|
|
}
|
|
|
|
|
|
/**
|
|
* @notes 编辑场景
|
|
* @return UserGroupRuleValidate
|
|
* @author BD
|
|
* @date 2024/04/25 01:30
|
|
*/
|
|
public function sceneEdit()
|
|
{
|
|
return $this->only(['id','num','money_type','commission_type']);
|
|
}
|
|
|
|
|
|
/**
|
|
* @notes 删除场景
|
|
* @return UserGroupRuleValidate
|
|
* @author BD
|
|
* @date 2024/04/25 01:30
|
|
*/
|
|
public function sceneDelete()
|
|
{
|
|
return $this->only(['id']);
|
|
}
|
|
|
|
|
|
/**
|
|
* @notes 详情场景
|
|
* @return UserGroupRuleValidate
|
|
* @author BD
|
|
* @date 2024/04/25 01:30
|
|
*/
|
|
public function sceneDetail()
|
|
{
|
|
return $this->only(['id']);
|
|
}
|
|
|
|
} |