first commit
This commit is contained in:
89
app/adminapi/validate/user/UserGroupRuleValidate.php
Normal file
89
app/adminapi/validate/user/UserGroupRuleValidate.php
Normal file
@@ -0,0 +1,89 @@
|
||||
<?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']);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user