<?php

namespace app\common\validate;
use think\Validate;

class Companys extends Validate
{
    // 验证规则
    protected $rule = [
        'id' => 'require|number',
        'contacts' => 'require|max:32',
        'mobile' => 'require|max:16',
        'province_id' => 'require|number',
        'city_id' => 'require|number',
        'area_id' => 'require|number',
        'address' => 'require|max:255',
        'aptitude_images' => 'require|max:256',
    ];

    // 验证提示
    protected $message = [
        'id.require' => '请输入门店ID',
        'id.number' => '您输入的门店ID，必须是数字类型',
        'contacts.require' => '请输入联系人',
        'contacts.max' => '您输入的联系人，必须小于32字符',
        'mobile.require' => '请输入联系电话',
        'mobile.max' => '您输入的联系电话，必须小于16字符',
        'province_id.require' => '请输入省',
        'province_id.number' => '您输入的省，必须是数字类型',
        'city_id.require' => '请输入市',
        'city_id.number' => '您输入的市，必须是数字类型',
        'area_id.require' => '请输入区县',
        'area_id.number' => '您输入的区县，必须是数字类型',
        'address.require' => '请输入联系地址',
        'address.max' => '您输入的联系地址，必须小于255字符',
        'aptitude_images.require' => '请输入资质',
        'aptitude_images.max' => '您输入的资质，必须小于256字符',
    ];

    // 应用场景
    protected $scene = [
        'add' => ['contacts','mobile','province_id','city_id','area_id','address','aptitude_images'],
        'edit' => ['contacts','mobile','province_id','city_id','area_id','address','aptitude_images'],
    ];
}