<?php

namespace app\admin\validate;

use app\common\validate\Base;

class Item extends Base
{
    protected $rule = [
        'name' => 'require|max:20',
        'preview' => 'max:25',
        'tag' => 'max:255',
        'tag_bg' => 'require|between:1,7',
        'is_show_price' => 'require|between:0,1',
        'price1' => 'price',
        'price2' => 'price',
        'sale' => 'number',
        'sale_minute' => 'number',
        'sale_count' => 'number',
        'countdown1' => 'number',
        'countdown2' => 'number',
        'is_show_send' => 'require|between:0,1',
        'is_distribution' => 'require|between:0,1',
        'title' => 'max:255',
        'keyword' => 'max:255',
        'description' => 'max:255',
        'width' => 'require|number',
        'bg_color' => 'require|max:20',
        'copyright' => 'max:255',
        'code_type' => 'require|between:0,1',
        'code' => 'max:65535',
        'tel' => 'number',
        'sms' => 'number',
        'qq' => 'number',
        'picture' => 'max:233',
        'buy' => 'max:65535',
        'procedure' => 'max:65535',
        'introduce' => 'max:65535',
        'service' => 'max:65535',
        'comment_type' => 'checkbox:0,1,2',
        'comment' => 'max:65535',
        'column_name1' => 'max:15',
        'column_content1' => 'max:65535',
        'column_name2' => 'max:15',
        'column_content2' => 'max:65535',
        'column_name3' => 'max:15',
        'column_content3' => 'max:65535',
        'column_name4' => 'max:15',
        'column_content4' => 'max:65535',
        'column_name5' => 'max:15',
        'column_content5' => 'max:65535',
        'product_type' => 'require|between:0,1',
        'product_sort_ids' => 'max:255',
        'product_ids' => 'max:255',
        'product_view_type' => 'require|between:0,1',
        'sort' => 'require|checkbox:0,1,2,3,4,5,6,7,8,9,10,11',
        'nav' => 'max:65535',
        'icon' => 'max:255',
        'share_title' => 'max:50',
        'share_pic' => 'max:25',
        'share_desc' => 'max:100',
    ];
    protected $message = [
        'name' => '商品名称不得为空或大于20位！',
        'preview' => '预览图不得大于25位！',
        'tag' => '商品标签不得大于255位！',
        'tag_bg' => '标签背景设置不合法！',
        'is_show_price' => '商品价格显示/隐藏设置不合法！',
        'price1' => '商品原价必须是数字！',
        'price2' => '促销价必须是数字！',
        'sale' => '销售量必须是数字！',
        'sale_minute' => '销售量递增间隔必须是数字！',
        'sale_count' => '销售量递增数必须是数字！',
        'countdown' => '促销倒计时1必须是数字！',
        'countdown2' => '促销倒计时2必须是数字！',
        'is_show_send' => '发货通知设置不合法！',
        'is_distribution' => '参与分销设置不合法！',
        'title' => '网页标题不得大于255位！',
        'keyword' => '网页关键词不得大于255位！',
        'description' => '网页描述不得大于255位！',
        'width' => '网页宽度必须是数字！',
        'bg_color' => '网页背景不得为空或大于20位！',
        'copyright' => '底部版权不得大于255位！',
        'code_type' => '第三方代码类型不合法！',
        'code' => '第三方代码不得大于65535位！',
        'tel' => '便于手机端用户直接拨打电话，联系电话必须是数字！',
        'sms' => '便于手机端用户直接发送短信，短信号码必须是数字！',
        'qq' => 'QQ必须是数字！',
        'picture' => '最多只能上传9张商品主图！',
        'buy' => '抢购描述不得大于65535位！',
        'procedure' => '购买流程不得大于65535位！',
        'introduce' => '商品介绍不得大于65535位！',
        'service' => '客户服务不得大于65535位！',
        'comment_type' => '客户评价设置不合法！',
        'comment' => '评价内容不得大于65535位！',
        'column_name1' => '自定义栏目名称1不得大于15位！',
        'column_content1' => '自定义栏目内容1不得大于65535位！',
        'column_name2' => '自定义栏目名称2不得大于15位！',
        'column_content2' => '自定义栏目内容2不得大于65535位！',
        'column_name3' => '自定义栏目名称3不得大于15位！',
        'column_content3' => '自定义栏目内容3不得大于65535位！',
        'column_name4' => '自定义栏目名称4不得大于15位！',
        'column_content4' => '自定义栏目内容4不得大于65535位！',
        'column_name5' => '自定义栏目名称5不得大于15位！',
        'column_content5' => '自定义栏目内容5不得大于65535位！',
        'product_type' => '商品分类设置不合法！',
        'product_sort_ids' => '选择的商品分类过多！',
        'product_ids' => '选择的商品过多！',
        'product_view_type' => '商品显示设置不合法！',
        'sort' => '栏目排序设置不合法！',
        'nav' => '导航链接不得大于65535位！',
        'icon' => '导航图标不得大于255位！',
        'share_title' => '分享标题不得大于50位！',
        'share_pic' => '分享预览图不得大于25位！',
        'share_desc' => '分享摘要不得大于100位！',
    ];
}
