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.
112 lines
5.7 KiB
112 lines
5.7 KiB
3 months ago
|
<?php
|
||
|
|
||
|
namespace app\admin\validate\setting;
|
||
|
|
||
|
use app\admin\validate\AdminBaseValidate;
|
||
|
|
||
|
class StockValidate extends AdminBaseValidate
|
||
|
{
|
||
|
protected $rule = [
|
||
|
'page' => 'require|integer',
|
||
|
'limit' => 'require|integer',
|
||
|
'stock_name' => 'require|checkIsString',
|
||
|
'stock_code' => 'require|checkIsString',
|
||
|
'status' => 'checkStatusRequire|in:0,1',
|
||
|
'keep_decimal' => 'checkNumberIntAt',
|
||
|
'forced_closure' => 'require|checkNumberFloatBg',
|
||
|
'up_limit' => 'require|checkNumberFloatBg',
|
||
|
'down_limit' => 'require|checkNumberFloatBg',
|
||
|
'id' => 'require|checkNumberIntBg',
|
||
|
];
|
||
|
|
||
|
protected $message = [
|
||
|
'page.require' => '分页参数无效',
|
||
|
'page.integer' => '分页参数无效',
|
||
|
'limit.require' => '分页参数无效',
|
||
|
'limit.integer' => '分页参数无效',
|
||
|
'stock_name.require' => '股票名称无效',
|
||
|
'stock_name.checkIsString' => '股票名称无效',
|
||
|
|
||
|
'stock_code.require' => '股票代码无效',
|
||
|
'stock_code.checkIsString' => '股票代码无效',
|
||
|
|
||
|
'status.checkStatusRequire' => '状态无效',
|
||
|
'status.in' => '状态无效',
|
||
|
|
||
|
'keep_decimal.require' => '保留小数位无效',
|
||
|
'keep_decimal.checkNumberIntBg' => '保留小数位无效',
|
||
|
|
||
|
'forced_closure.require' => '强制平仓阈值无效',
|
||
|
'forced_closure.checkNumberFloatBg' => '强制平仓阈值无效',
|
||
|
|
||
|
'up_limit.require' => '涨停限制无效',
|
||
|
'up_limit.checkNumberFloatBg' => '涨停限制无效',
|
||
|
|
||
|
'down_limit.require' => '跌停限制无效',
|
||
|
'down_limit.checkNumberFloatBg' => '跌停限制无效',
|
||
|
|
||
|
'id.require' => '主键无效',
|
||
|
'id.checkNumberIntBg' => '主键无效',
|
||
|
|
||
|
];
|
||
|
|
||
|
|
||
|
protected $scene = [
|
||
|
// 美股
|
||
|
'us_stock_index' => ['page', 'limit'],
|
||
|
'us_stock_add' => ['stock_name', 'stock_code', 'status', 'keep_decimal', 'forced_closure', 'up_limit', 'down_limit'],
|
||
|
'us_stock_edit' => ['id', 'stock_name', 'stock_code', 'status', 'keep_decimal', 'forced_closure', 'up_limit', 'down_limit'],
|
||
|
|
||
|
// 印尼股
|
||
|
'idn_stock_index' => ['page', 'limit'],
|
||
|
'idn_stock_add' => ['stock_name', 'stock_code', 'status', 'keep_decimal', 'forced_closure', 'up_limit', 'down_limit'],
|
||
|
'idn_stock_edit' => ['id', 'stock_name', 'stock_code', 'status', 'keep_decimal', 'forced_closure', 'up_limit', 'down_limit'],
|
||
|
|
||
|
// 马股
|
||
|
'mys_stock_index' => ['page', 'limit'],
|
||
|
'mys_stock_add' => ['stock_name', 'stock_code', 'status', 'keep_decimal', 'forced_closure', 'up_limit', 'down_limit'],
|
||
|
'mys_stock_edit' => ['id', 'stock_name', 'stock_code', 'status', 'keep_decimal', 'forced_closure', 'up_limit', 'down_limit'],
|
||
|
|
||
|
// 印度
|
||
|
'in_stock_index' => ['page', 'limit'],
|
||
|
'in_stock_add' => ['stock_name', 'stock_code', 'status', 'keep_decimal', 'forced_closure', 'up_limit', 'down_limit'],
|
||
|
'in_stock_edit' => ['id', 'stock_name', 'stock_code', 'status', 'keep_decimal', 'forced_closure', 'up_limit', 'down_limit'],
|
||
|
|
||
|
// 泰股
|
||
|
'tha_stock_index' => ['page', 'limit'],
|
||
|
'tha_stock_add' => ['stock_name', 'stock_code', 'status', 'keep_decimal', 'forced_closure', 'up_limit', 'down_limit'],
|
||
|
'tha_stock_edit' => ['id', 'stock_name', 'stock_code', 'status', 'keep_decimal', 'forced_closure', 'up_limit', 'down_limit'],
|
||
|
// 新加坡
|
||
|
'sgd_stock_index' => ['page', 'limit'],
|
||
|
'sgd_stock_add' => ['stock_name', 'stock_code', 'status', 'keep_decimal', 'forced_closure', 'up_limit', 'down_limit'],
|
||
|
'sgd_stock_edit' => ['id', 'stock_name', 'stock_code', 'status', 'keep_decimal', 'forced_closure', 'up_limit', 'down_limit'],
|
||
|
// 香港
|
||
|
'hk_stock_index' => ['page', 'limit'],
|
||
|
'hk_stock_add' => ['stock_name', 'stock_code', 'status', 'keep_decimal', 'forced_closure', 'up_limit', 'down_limit'],
|
||
|
'hk_stock_edit' => ['id', 'stock_name', 'stock_code', 'status', 'keep_decimal', 'forced_closure', 'up_limit', 'down_limit'],
|
||
|
// 英国
|
||
|
'gbx_stock_index' => ['page', 'limit'],
|
||
|
'gbx_stock_add' => ['stock_name', 'stock_code', 'status', 'keep_decimal', 'forced_closure', 'up_limit', 'down_limit'],
|
||
|
'gbx_stock_edit' => ['id', 'stock_name', 'stock_code', 'status', 'keep_decimal', 'forced_closure', 'up_limit', 'down_limit'],
|
||
|
// 法国
|
||
|
'fur_stock_index' => ['page', 'limit'],
|
||
|
'fur_stock_add' => ['stock_name', 'stock_code', 'status', 'keep_decimal', 'forced_closure', 'up_limit', 'down_limit'],
|
||
|
'fur_stock_edit' => ['id', 'stock_name', 'stock_code', 'status', 'keep_decimal', 'forced_closure', 'up_limit', 'down_limit'],
|
||
|
// 德国
|
||
|
'eur_stock_index' => ['page', 'limit'],
|
||
|
'eur_stock_add' => ['stock_name', 'stock_code', 'status', 'keep_decimal', 'forced_closure', 'up_limit', 'down_limit'],
|
||
|
'eur_stock_edit' => ['id', 'stock_name', 'stock_code', 'status', 'keep_decimal', 'forced_closure', 'up_limit', 'down_limit'],
|
||
|
// 德国
|
||
|
'jp_stock_index' => ['page', 'limit'],
|
||
|
'jp_stock_add' => ['stock_name', 'stock_code', 'status', 'keep_decimal', 'forced_closure', 'up_limit', 'down_limit'],
|
||
|
'jp_stock_edit' => ['id', 'stock_name', 'stock_code', 'status', 'keep_decimal', 'forced_closure', 'up_limit', 'down_limit'],
|
||
|
|
||
|
// 印度期权
|
||
|
'in_option_index' => ['page', 'limit'],
|
||
|
'in_option_add' => ['stock_name', 'stock_code', 'status', 'keep_decimal', 'forced_closure'],
|
||
|
'in_option_edit' => ['id', 'stock_name', 'stock_code', 'status', 'keep_decimal', 'forced_closure'],
|
||
|
|
||
|
//自动添加股票
|
||
|
'stock_auto_add' => ['stock_name', 'stock_code', 'tape', 'country'],
|
||
|
];
|
||
|
}
|