97 lines
1.9 KiB
PHP
97 lines
1.9 KiB
PHP
<?php
|
|
namespace app\adminapi\validate\mall;
|
|
|
|
|
|
use app\common\validate\BaseValidate;
|
|
|
|
|
|
/**
|
|
* 积分、抽奖奖品验证器
|
|
* Class MallGoodsValidate
|
|
* @package app\adminapi\validate\mall
|
|
*/
|
|
class MallGoodsValidate extends BaseValidate
|
|
{
|
|
|
|
/**
|
|
* 设置校验规则
|
|
* @var string[]
|
|
*/
|
|
protected $rule = [
|
|
'id' => 'require',
|
|
'title' => 'require',
|
|
'price' => 'require',
|
|
'money' => 'require',
|
|
'point' => 'require',
|
|
'type' => 'require',
|
|
'type2' => 'require',
|
|
'is_show' => 'require',
|
|
'sort' => 'require',
|
|
];
|
|
|
|
|
|
/**
|
|
* 参数描述
|
|
* @var string[]
|
|
*/
|
|
protected $field = [
|
|
'id' => 'id',
|
|
'title' => '奖品标题',
|
|
'price' => '所需积分',
|
|
'money' => '现金金额',
|
|
'point' => '奖品积分',
|
|
'type' => '奖品分类',
|
|
'type2' => '奖品类型',
|
|
'is_show' => '显示状态',
|
|
'sort' => '排序',
|
|
];
|
|
|
|
|
|
/**
|
|
* @notes 添加场景
|
|
* @return MallGoodsValidate
|
|
* @author BD
|
|
* @date 2024/10/14 23:57
|
|
*/
|
|
public function sceneAdd()
|
|
{
|
|
return $this->only(['title','price','money','point','type','type2','is_show','sort']);
|
|
}
|
|
|
|
|
|
/**
|
|
* @notes 编辑场景
|
|
* @return MallGoodsValidate
|
|
* @author BD
|
|
* @date 2024/10/14 23:57
|
|
*/
|
|
public function sceneEdit()
|
|
{
|
|
return $this->only(['id','title','price','money','point','type','type2','is_show','sort']);
|
|
}
|
|
|
|
|
|
/**
|
|
* @notes 删除场景
|
|
* @return MallGoodsValidate
|
|
* @author BD
|
|
* @date 2024/10/14 23:57
|
|
*/
|
|
public function sceneDelete()
|
|
{
|
|
return $this->only(['id']);
|
|
}
|
|
|
|
|
|
/**
|
|
* @notes 详情场景
|
|
* @return MallGoodsValidate
|
|
* @author BD
|
|
* @date 2024/10/14 23:57
|
|
*/
|
|
public function sceneDetail()
|
|
{
|
|
return $this->only(['id']);
|
|
}
|
|
|
|
} |