Merge branch 'develop'
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace app\common\validate;
|
||||
|
||||
use think\Validate;
|
||||
|
||||
class StockOrderAccountsValidate extends Validate
|
||||
{
|
||||
// 规则
|
||||
protected $rule = [
|
||||
|
||||
];
|
||||
|
||||
// 提示
|
||||
protected $message = [
|
||||
|
||||
];
|
||||
|
||||
// 场景
|
||||
protected $scene = [
|
||||
'store' => [
|
||||
|
||||
],
|
||||
|
||||
'update' => [
|
||||
|
||||
]
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace app\common\validate;
|
||||
|
||||
use think\Validate;
|
||||
|
||||
class StockOrderItemOptionsValidate extends Validate
|
||||
{
|
||||
// 规则
|
||||
protected $rule = [
|
||||
|
||||
];
|
||||
|
||||
// 提示
|
||||
protected $message = [
|
||||
|
||||
];
|
||||
|
||||
// 场景
|
||||
protected $scene = [
|
||||
'store' => [
|
||||
|
||||
],
|
||||
|
||||
'update' => [
|
||||
|
||||
]
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace app\common\validate;
|
||||
|
||||
use think\Validate;
|
||||
|
||||
class StockOrderItemsValidate extends Validate
|
||||
{
|
||||
// 规则
|
||||
protected $rule = [
|
||||
|
||||
];
|
||||
|
||||
// 提示
|
||||
protected $message = [
|
||||
|
||||
];
|
||||
|
||||
// 场景
|
||||
protected $scene = [
|
||||
'store' => [
|
||||
|
||||
],
|
||||
|
||||
'update' => [
|
||||
|
||||
]
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace app\common\validate;
|
||||
|
||||
use think\Validate;
|
||||
|
||||
class StockOrdersValidate extends Validate
|
||||
{
|
||||
// 规则
|
||||
protected $rule = [
|
||||
|
||||
];
|
||||
|
||||
// 提示
|
||||
protected $message = [
|
||||
|
||||
];
|
||||
|
||||
// 场景
|
||||
protected $scene = [
|
||||
'store' => [
|
||||
|
||||
],
|
||||
|
||||
'update' => [
|
||||
|
||||
]
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
<?php
|
||||
|
||||
namespace app\common\validate;
|
||||
|
||||
use think\Validate;
|
||||
|
||||
class UploadedFilesValidate extends Validate
|
||||
{
|
||||
/**
|
||||
* 验证规则
|
||||
*/
|
||||
protected $rule = [
|
||||
'file_name' => 'require|max:255',
|
||||
'file_path' => 'require|max:500',
|
||||
'file_size' => 'require|integer|gt:0',
|
||||
'file_type' => 'require|max:100',
|
||||
'category' => 'require|max:50',
|
||||
'original_name' => 'max:255',
|
||||
'extension' => 'max:20',
|
||||
'partition' => 'max:50',
|
||||
'upload_ip' => 'ip',
|
||||
'user_agent' => 'max:500',
|
||||
];
|
||||
|
||||
/**
|
||||
* 验证消息
|
||||
*/
|
||||
protected $message = [
|
||||
'file_name.require' => '文件名不能为空',
|
||||
'file_name.max' => '文件名长度不能超过255个字符',
|
||||
'file_path.require' => '文件路径不能为空',
|
||||
'file_path.max' => '文件路径长度不能超过500个字符',
|
||||
'file_size.require' => '文件大小不能为空',
|
||||
'file_size.integer' => '文件大小必须是整数',
|
||||
'file_size.gt' => '文件大小必须大于0',
|
||||
'file_type.require' => '文件类型不能为空',
|
||||
'file_type.max' => '文件类型长度不能超过100个字符',
|
||||
'category.require' => '文件分类不能为空',
|
||||
'category.max' => '文件分类长度不能超过50个字符',
|
||||
'original_name.max' => '原始文件名长度不能超过255个字符',
|
||||
'extension.max' => '文件扩展名长度不能超过20个字符',
|
||||
'partition.max' => '分区名称长度不能超过50个字符',
|
||||
'upload_ip.ip' => '上传IP格式不正确',
|
||||
'user_agent.max' => '用户代理长度不能超过500个字符',
|
||||
];
|
||||
|
||||
/**
|
||||
* 验证场景
|
||||
*/
|
||||
protected $scene = [
|
||||
'create' => ['file_name', 'file_path', 'file_size', 'file_type', 'category'],
|
||||
'update' => ['file_name', 'file_path', 'file_size', 'file_type', 'category', 'original_name', 'extension', 'partition'],
|
||||
'search' => ['category', 'partition', 'file_type'],
|
||||
];
|
||||
|
||||
/**
|
||||
* 验证文件上传
|
||||
*/
|
||||
public function sceneUpload()
|
||||
{
|
||||
return $this->append('file_name', 'require|max:255')
|
||||
->append('file_path', 'require|max:500')
|
||||
->append('file_size', 'require|integer|gt:0')
|
||||
->append('file_type', 'require|max:100')
|
||||
->append('category', 'require|max:50')
|
||||
->append('original_name', 'max:255')
|
||||
->append('extension', 'max:20')
|
||||
->append('partition', 'max:50')
|
||||
->append('upload_ip', 'ip')
|
||||
->append('user_agent', 'max:500');
|
||||
}
|
||||
|
||||
/**
|
||||
* 验证文件信息更新
|
||||
*/
|
||||
public function sceneUpdateInfo()
|
||||
{
|
||||
return $this->append('file_name', 'require|max:255')
|
||||
->append('category', 'require|max:50')
|
||||
->append('original_name', 'max:255');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace app\common\validate;
|
||||
|
||||
use think\Validate;
|
||||
|
||||
class VehDictI18nValidate extends Validate
|
||||
{
|
||||
// 规则
|
||||
protected $rule = [
|
||||
|
||||
];
|
||||
|
||||
// 提示
|
||||
protected $message = [
|
||||
|
||||
];
|
||||
|
||||
// 场景
|
||||
protected $scene = [
|
||||
'store' => [
|
||||
|
||||
],
|
||||
|
||||
'update' => [
|
||||
|
||||
]
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace app\common\validate;
|
||||
|
||||
use think\Validate;
|
||||
|
||||
class VehDictMappingValidate extends Validate
|
||||
{
|
||||
// 规则
|
||||
protected $rule = [
|
||||
|
||||
];
|
||||
|
||||
// 提示
|
||||
protected $message = [
|
||||
|
||||
];
|
||||
|
||||
// 场景
|
||||
protected $scene = [
|
||||
'store' => [
|
||||
|
||||
],
|
||||
|
||||
'update' => [
|
||||
|
||||
]
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace app\common\validate;
|
||||
|
||||
use think\Validate;
|
||||
|
||||
class VehMoneyValueValidate extends Validate
|
||||
{
|
||||
// 规则
|
||||
protected $rule = [
|
||||
|
||||
];
|
||||
|
||||
// 提示
|
||||
protected $message = [
|
||||
|
||||
];
|
||||
|
||||
// 场景
|
||||
protected $scene = [
|
||||
'store' => [
|
||||
|
||||
],
|
||||
|
||||
'update' => [
|
||||
|
||||
]
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace app\common\validate;
|
||||
|
||||
use think\Validate;
|
||||
|
||||
class VehVehicleListingValidate extends Validate
|
||||
{
|
||||
// 规则
|
||||
protected $rule = [
|
||||
|
||||
];
|
||||
|
||||
// 提示
|
||||
protected $message = [
|
||||
|
||||
];
|
||||
|
||||
// 场景
|
||||
protected $scene = [
|
||||
'store' => [
|
||||
|
||||
],
|
||||
|
||||
'update' => [
|
||||
|
||||
]
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,128 @@
|
||||
<?php
|
||||
|
||||
namespace app\common\validate;
|
||||
|
||||
use think\Validate;
|
||||
|
||||
class VehVehicleSkuValidate extends Validate
|
||||
{
|
||||
/**
|
||||
* 规则定义
|
||||
*/
|
||||
protected $rule = [
|
||||
'sku_code' => 'max:40|alphaNum',
|
||||
'fingerprint' => 'length:64|alphaNum',
|
||||
'brand_code' => 'require|max:32',
|
||||
'brand_name' => 'require|max:64',
|
||||
'series_code' => 'max:64',
|
||||
'series_name' => 'max:128',
|
||||
'model_code' => 'max:64',
|
||||
'model_name' => 'require|max:128',
|
||||
'model_year' => 'require|number|between:1900,2100',
|
||||
'trim_code' => 'max:64',
|
||||
'trim_level_code' => 'max:64',
|
||||
'edition_code' => 'max:64',
|
||||
'trim' => 'max:128',
|
||||
'trim_level' => 'max:64',
|
||||
'edition_name' => 'max:64',
|
||||
'body_type_code' => 'max:32',
|
||||
'drive_type_code' => 'max:16',
|
||||
'motor_layout_code' => 'max:32',
|
||||
'fuel_type_code' => 'max:16',
|
||||
'engine_disp_l' => 'float|between:0,99.9',
|
||||
'engine_turbo' => 'in:0,1',
|
||||
'engine_power_kw' => 'number|between:0,2000',
|
||||
'battery_kwh' => 'float|between:0,999.99',
|
||||
'transmission_code' => 'max:16',
|
||||
'gears' => 'number|between:1,20',
|
||||
'range_km' => 'number|between:0,2000',
|
||||
'range_std_code' => 'max:16',
|
||||
'doors' => 'number|between:2,10',
|
||||
'seats' => 'number|between:1,20',
|
||||
'weight_kg' => 'number|between:0,10000',
|
||||
'dimensions_mm' => 'array',
|
||||
'color_exterior_code'=> 'max:32',
|
||||
'color_exterior_text'=> 'max:64',
|
||||
'color_interior_code'=> 'max:32',
|
||||
'color_interior_text'=> 'max:64',
|
||||
'options_official' => 'array',
|
||||
'features' => 'array',
|
||||
'emission_std_code' => 'max:16',
|
||||
'origin_country' => 'alpha|length:2',
|
||||
'currency' => 'require|alpha|length:3',
|
||||
'msrp' => 'float|between:0,9999999999.99',
|
||||
'is_active' => 'in:0,1',
|
||||
'corp_id' => 'require|number',
|
||||
'remark' => 'max:255',
|
||||
'created_by' => 'number',
|
||||
'updated_by' => 'number',
|
||||
'created_at' => 'require|number',
|
||||
'updated_at' => 'require|number',
|
||||
];
|
||||
|
||||
/**
|
||||
* 字段别名
|
||||
*/
|
||||
protected $field = [
|
||||
'sku_code' => 'SKU编码',
|
||||
'fingerprint' => '规格指纹',
|
||||
'brand_code' => '品牌代码',
|
||||
'brand_name' => '品牌名称',
|
||||
'series_code' => '车系代码',
|
||||
'series_name' => '车系名称',
|
||||
'model_code' => '车型代码',
|
||||
'model_name' => '车型名称',
|
||||
'model_year' => '年款',
|
||||
'trim_code' => '版型代码',
|
||||
'trim_level_code' => '配置等级代码',
|
||||
'edition_code' => '特别版代码',
|
||||
'trim' => '版型/细分配置',
|
||||
'trim_level' => '配置等级',
|
||||
'edition_name' => '特别版名称',
|
||||
'body_type_code' => '车身类型',
|
||||
'drive_type_code' => '驱动方式',
|
||||
'motor_layout_code' => '电机布置',
|
||||
'fuel_type_code' => '能源类型',
|
||||
'engine_disp_l' => '排量(L)',
|
||||
'engine_turbo' => '是否涡轮',
|
||||
'engine_power_kw' => '最大功率(kW)',
|
||||
'battery_kwh' => '电池容量(kWh)',
|
||||
'transmission_code' => '变速箱代码',
|
||||
'gears' => '挡位数',
|
||||
'range_km' => '续航里程',
|
||||
'range_std_code' => '续航标准',
|
||||
'doors' => '门数',
|
||||
'seats' => '座位数',
|
||||
'weight_kg' => '整备质量',
|
||||
'dimensions_mm' => '车身尺寸',
|
||||
'color_exterior_code'=> '外观色代码',
|
||||
'color_exterior_text'=> '外观色名称',
|
||||
'color_interior_code'=> '内饰色代码',
|
||||
'color_interior_text'=> '内饰色名称',
|
||||
'options_official' => '官方选装',
|
||||
'features' => '功能配置',
|
||||
'emission_std_code' => '排放标准',
|
||||
'origin_country' => '原产国',
|
||||
'currency' => '币种',
|
||||
'msrp' => '建议零售价',
|
||||
'is_active' => '是否启用',
|
||||
'corp_id' => '公司ID',
|
||||
'remark' => '备注',
|
||||
'created_by' => '创建人',
|
||||
'updated_by' => '更新人',
|
||||
'created_at' => '创建时间',
|
||||
'updated_at' => '更新时间',
|
||||
];
|
||||
|
||||
/**
|
||||
* 场景定义
|
||||
*/
|
||||
protected $scene = [
|
||||
'store' => [
|
||||
'brand_code', 'brand_name', 'model_year','currency'
|
||||
],
|
||||
'update' => [
|
||||
'id', 'brand_code','brand_name', 'model_year','currency'
|
||||
],
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace app\common\validate;
|
||||
|
||||
use think\Validate;
|
||||
|
||||
class VehVehicleUnitValidate extends Validate
|
||||
{
|
||||
// 规则
|
||||
protected $rule = [
|
||||
|
||||
];
|
||||
|
||||
// 提示
|
||||
protected $message = [
|
||||
|
||||
];
|
||||
|
||||
// 场景
|
||||
protected $scene = [
|
||||
'store' => [
|
||||
|
||||
],
|
||||
|
||||
'update' => [
|
||||
|
||||
]
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user