<?php


namespace Validate;


/**
 * Class addValidate
 *
 * @package Validate
 */
class OtaValidate extends \Validate\BaseValidate
{
    protected $rule = [
        'ota_name' => 'require',
        'ota_id' => 'require',
        'address' => 'require',
        'location' => 'require',
        'longitude' => 'require',
        'latitude' => 'require',
        'offset' => 'egt:0',
        'limit' => 'elt:100',
    ];


    protected $message = [
        "ota_name" => "供应商名称不能为空",
        "ota_id" => "ota_id不能为空",
        "address" => "详细地址不能为空",
        "location" => "高德地图详细地址不能为空",
        "longitude" => "经度不能为空",
        "latitude" => "纬度不能为空",
        "offset" => "偏移量不能小于0",
        "limit" => "单次不能大于100条",
    ];


    public function sceneList()
    {
        return $this->only(['offset','limit']);
    }

    public function sceneAdd()
    {
        return $this->only(['ota_name', 'address','longitude','latitude', 'location']);
    }
    public function sceneDelete()
    {
        return $this->only(['ota_id']);
    }

    public function sceneUpdate()
    {
        return $this->only(['ota_id', 'ota_name', 'address','longitude','latitude', 'location']);
    }
    public function sceneListByIds()
    {
        return $this->only(['ota_id']);
    }
}