erp/app/admin/validate/goods/GoodsclassValidate.php
2024-04-23 18:03:12 +08:00

86 lines
1.4 KiB
PHP

<?php
namespace app\admin\validate\goods;
use app\common\validate\BaseValidate;
/**
* 商品分类验证器
* Class GoodsclassValidate
* @package app\admin\validate\goods
*/
class GoodsclassValidate extends BaseValidate
{
/**
* 设置校验规则
* @var string[]
*/
protected $rule = [
'id' => 'require',
'pid' => 'require',
'name' => 'require',
];
/**
* 参数描述
* @var string[]
*/
protected $field = [
'id' => 'id',
'pid' => '所属ID',
'name' => '分类名称',
];
/**
* @notes 添加场景
* @return GoodsclassValidate
* @author likeadmin
* @date 2024/04/23 10:27
*/
public function sceneAdd()
{
return $this->only(['pid','name']);
}
/**
* @notes 编辑场景
* @return GoodsclassValidate
* @author likeadmin
* @date 2024/04/23 10:27
*/
public function sceneEdit()
{
return $this->only(['id','pid','name']);
}
/**
* @notes 删除场景
* @return GoodsclassValidate
* @author likeadmin
* @date 2024/04/23 10:27
*/
public function sceneDelete()
{
return $this->only(['id']);
}
/**
* @notes 详情场景
* @return GoodsclassValidate
* @author likeadmin
* @date 2024/04/23 10:27
*/
public function sceneDetail()
{
return $this->only(['id']);
}
}