1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798 |
- <?php
- namespace app\validate\admin;
- use think\Validate;
- class SystemConfigValidate extends Validate
- {
- protected $regex = [
- 'float_two' => '/^[0-9]+(.[0-9]{1,2})?$/',
- 'tel' => '/^((\d{3,4}-)?[0-9]{7,8}$)|(^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])[0-9]{8}$)$/'
- ];
-
- protected $rule = [
- 'site_url' => 'url',
- 'user_extract_min_price' => 'float|gt:0',
- 'store_brokerage_price' => 'float|gt:0',
- 'thumb_big_height' => 'number|egt:0',
- 'thumb_big_width' => 'number|egt:0',
- 'thumb_mid_height' => 'number|egt:0',
- 'thumb_mid_width' => 'number|egt:0',
- 'thumb_small_height' => 'number|egt:0',
- 'thumb_small_width' => 'number|egt:0',
- 'watermark_opacity' => 'number|between:0,100',
- 'watermark_text' => 'chsAlphaNum|length:1,10',
- 'watermark_text_size' => 'number|egt:0',
- 'watermark_x' => 'integer',
- 'watermark_y' => 'integer',
- 'store_extract_max_price' => 'float',
- 'store_extract_min_price' => 'float|egt:1',
- 'site_phone' => 'regex:tel',
- 'withdraw_fee' => 'float|egt:0|elt:100|regex:float_two',
- ];
-
- protected $message = [
- 'site_url.url' => '请输入有效的网址',
- 'user_extract_min_price.float' => '提现最小金额只能为数字',
- 'user_extract_min_price.gt' => '提现最小金额必须大于0',
- 'store_brokerage_price.float' => '满额分销金额金额必须为数字',
- 'store_brokerage_price.gt' => '满额分销金额金额必须大于0',
- 'thumb_big_height.number' => '缩略图大图尺寸(高)必须为整数',
- 'thumb_big_height.egt' => '缩略图大图尺寸(高)必须大于等于0',
- 'thumb_big_width.number' => '缩略图大图尺寸(宽)必须为整数',
- 'thumb_big_width.egt' => '缩略图大图尺寸(宽)必须大于等于0',
- 'thumb_mid_height.number' => '缩略图中图尺寸(高)必须为整数',
- 'thumb_mid_height.egt' => '缩略图中图尺寸(高)必须大于等于0',
- 'thumb_mid_width.number' => '缩略图中图尺寸(宽)必须为整数',
- 'thumb_mid_width.egt' => '缩略图中图尺寸(宽)必须大于等于0',
- 'thumb_small_height.number' => '缩略图小图尺寸(高)必须为整数',
- 'thumb_small_height.egt' => '缩略图小图尺寸(高)必须大于等于0',
- 'thumb_small_width.number' => '缩略图小图尺寸(宽)必须为整数',
- 'thumb_small_width.egt' => '缩略图小图尺寸(宽)必须大于等于0',
- 'watermark_text.chsAlphaNum' => '水印文字只能是汉字、字母、数字',
- 'watermark_text.length' => '水印文字长度为1-10位',
- 'watermark_text_size.number' => '水印文字大小必须为整数',
- 'watermark_text_size.egt' => '水印文字大小必须大于等于0',
- 'watermark_x.integer' => '水印横坐标偏移量必须为整数',
- 'watermark_y.integer' => '水印纵坐标偏移量必须为整数',
- 'store_extract_max_price.float' => '门店提现最高金额必须为数字',
- 'store_extract_min_price.float' => '门店提现最低金额必须为数字',
- 'store_extract_min_price.egt' => '门店提现最低金额为1元',
- 'site_phone.regex' => '请填写有效的联系电话',
- 'withdraw_fee.float' => '提现手续费必须为数字',
- 'withdraw_fee.egt' => '提现手续费为0-100数字',
- 'withdraw_fee.elt' => '提现手续费为0-100数字',
- 'withdraw_fee.regex' => '提现手续费最多两位小数',
- ];
- protected $scene = [
- ];
- }
|