1.提交缺失的东西

This commit is contained in:
2025-05-20 17:37:51 +08:00
parent 47f58fbc70
commit 8c6701e8e0
5 changed files with 439 additions and 0 deletions

View File

@ -0,0 +1,98 @@
<?php
// +----------------------------------------------------------------------
// | likeadmin快速开发前后端分离管理后台PHP版
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | gitee下载https://gitee.com/likeshop_gitee/likeadmin
// | github下载https://github.com/likeshop-github/likeadmin
// | 访问官网https://www.likeadmin.cn
// | likeadmin团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeadminTeam
// +----------------------------------------------------------------------
namespace app\adminapi\validate;
use app\common\validate\BaseValidate;
/**
* GoodsCategory验证器
* Class GoodsCategoryValidate
* @package app\adminapi\validate
*/
class GoodsCategoryValidate extends BaseValidate
{
/**
* 设置校验规则
* @var string[]
*/
protected $rule = [
'id' => 'require',
'name' => 'require',
'pid' => 'require',
];
/**
* 参数描述
* @var string[]
*/
protected $field = [
'id' => 'id',
'name' => '分类名称',
'pid' => '父级id',
];
/**
* @notes 添加场景
* @return GoodsCategoryValidate
* @author likeadmin
* @date 2025/05/20 17:35
*/
public function sceneAdd()
{
return $this->only(['name','pid']);
}
/**
* @notes 编辑场景
* @return GoodsCategoryValidate
* @author likeadmin
* @date 2025/05/20 17:35
*/
public function sceneEdit()
{
return $this->only(['id','name','pid']);
}
/**
* @notes 删除场景
* @return GoodsCategoryValidate
* @author likeadmin
* @date 2025/05/20 17:35
*/
public function sceneDelete()
{
return $this->only(['id']);
}
/**
* @notes 详情场景
* @return GoodsCategoryValidate
* @author likeadmin
* @date 2025/05/20 17:35
*/
public function sceneDetail()
{
return $this->only(['id']);
}
}