Files
dafuweng-saiadmin6.x/server/app/dice/validate/reward_config/DiceRewardConfigValidate.php

45 lines
1.8 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
// +----------------------------------------------------------------------
// | saiadmin [ saiadmin快速开发框架 ]
// +----------------------------------------------------------------------
// | Author: your name
// +----------------------------------------------------------------------
namespace app\dice\validate\reward_config;
use plugin\saiadmin\basic\BaseValidate;
/**
* 奖励配置验证器DiceRewardConfigBIGWIN 的 weight 存本表0-10000
*/
class DiceRewardConfigValidate extends BaseValidate
{
/** 色子点数范围530 共 26 个点数 */
public const GRID_NUMBER_MIN = 5;
public const GRID_NUMBER_MAX = 30;
protected $rule = [
'grid_number' => 'require|integer|between:5,30',
'ui_text' => 'require',
'ui_text_en' => 'max:255',
'real_ev' => 'require',
'tier' => 'require',
'type' => 'number',
'weight' => 'number|between:0,10000', // BIGWIN 大奖权重,仅档位为 BIGWIN 时使用
'remark' => 'max:500',
];
protected $message = [
'grid_number' => '色子点数必须为 530 之间的整数共26个点数',
'ui_text' => '前端显示文本必须填写',
'real_ev' => '真实资金结算必须填写',
'tier' => '所属档位必须填写',
'type' => '奖励类型须为数字',
];
protected $scene = [
'save' => ['grid_number', 'ui_text', 'ui_text_en', 'real_ev', 'tier', 'type'],
'update' => ['grid_number', 'ui_text', 'ui_text_en', 'real_ev', 'tier', 'type', 'weight', 'remark'],
'batch_update' => ['grid_number', 'ui_text', 'ui_text_en', 'real_ev', 'tier', 'remark'],
];
}