<?php

namespace app\admin\validate\life;

use support\Validate;

class FarmLandValidate extends Validate
{
    protected $rule = [
        'land_id' => 'require|integer',
        'land_name|地块名' => 'require',
        'land_price|价格' => 'require|float',
        'land_long|经度' => 'require|regex:/^[0-9\.]+$/',
        'land_lat|纬度' => 'require|regex:/^[0-9\.]+$/'
    ];

    protected $message = [];

    protected $scene = [
        'add' => ['land_name', 'land_price', 'land_long', 'land_lat'],
        'update' => ['land_id', 'land_name', 'land_price', 'land_long', 'land_lat'],
        'info'=>['land_id'],
    ];
}