You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
1.1 KiB
42 lines
1.1 KiB
<?php
|
|
declare (strict_types = 1);
|
|
|
|
namespace app\validate;
|
|
|
|
use think\Validate;
|
|
|
|
class Zone extends Validate
|
|
{
|
|
|
|
/**
|
|
* 定义验证规则
|
|
* 格式:'字段名' => ['规则1','规则2'...]
|
|
*
|
|
* @var array
|
|
*/
|
|
protected $rule = [
|
|
'zone_id|专区id' => 'require|number',
|
|
'status' => 'in:0,1',
|
|
'zone_goods_id|刮奖专区id' => 'require|number',
|
|
'amount|奖金金额' => 'require|number',
|
|
'probability|中奖率' => 'require|float|max:7',
|
|
'z_g_p_id|奖金id' => 'require|number',
|
|
'image|图片logo' => 'require'
|
|
];
|
|
|
|
/**
|
|
* 定义错误信息
|
|
* 格式:'字段名.规则名' => '错误信息'
|
|
*
|
|
* @var array
|
|
*/
|
|
protected $message = [];
|
|
|
|
protected $scene = [
|
|
'changeStatus' => ['zone_goods_id','status'],
|
|
'goodsParamList' => ['zone_goods_id'],
|
|
'goodsParamAdd' => ['amount','probability','zone_goods_id'],
|
|
'goodsParamEdit' => ['z_g_p_id','amount','probability','zone_goods_id'],
|
|
'goodsParamDel' => ['z_g_p_id'],
|
|
];
|
|
}
|
|
|