<?php

namespace app\admin\validate\life;

use support\Validate;

class TravelLineValidate extends Validate
{
    protected $rule = [
        'line_id' => 'require|integer',
        'line_shop_id' => 'integer',
        'line_category_id' => 'integer',
        'line_name' => 'require|max:255',
        'line_image' => 'require|regex:/^[0-9a-zA-Z\.\/]+$/',
        'line_slide' => 'require|regex:/^[0-9a-zA-Z\.\/\,]+$/',
        'line_person_num' => 'integer',
        'line_tags' => 'max:255',
        'line_price' => 'require|float',
    ];

    protected $message = [];

    protected $scene = [
        'add' => ['line_shop_id', 'line_category_id', 'line_name', 'line_image', 'line_slide', 'line_person_num', 'line_tags', 'line_price'],
        'update' => ['line_id', 'line_shop_id', 'line_category_id', 'line_name', 'line_image', 'line_slide', 'line_person_num', 'line_tags', 'line_price'],
    ];
}