<?php
namespace app\admin\validate\life;

use think\Validate;

class FarmLandValidate extends Validate
{
    protected $rule =   [
        'land_name'  => 'require|max:20',
        'land_id'    => 'require',
        'land_price' => 'require',
        'land_longitude' => 'require',
        'land_latitude' => 'require',
    ];

    protected $message  =   [
        'land_id.require' => '地块ID不能为空',
        'land_name.require' => '地块名称不能为空',
        'land_price.require' => '地块价格不能为空',
        'land_longitude.require' => '地块经度不能为空',
        'land_latitude.require' => '地块纬度不能为空',
    ];

    //场景
    protected $scene = [
        'create'   => ['land_name','land_price','land_longitude','land_latitude'],
        'update'   => ['land_id'],
        'info'     => ['land_id']
    ];
}
