LogisticsValidate.php 732 字节
<?php
/**
 * Created by PhpStorm.
 * User: 29925
 * Date: 2018/8/20
 * Time: 11:38
 */

namespace app\admin\validate;

use think\Validate;

class LogisticsValidate extends Validate
{

    protected $rule = [
        'send_time'       => 'require',
        'version'        => 'require',
        'express'       => 'require|unique:logistics,express',
    ];

    protected $message = [
        'send_time.require'      => '发货时间不能为空',
        'version.unique'       => '版本不能为空',
        'express.require'   => '物流单号不能为空',
        'express.unique'        => '物流单号已存在',
    ];

    protected $scene = [
        'add'  => ['name'],
        'edit' => ['name', 'is_stop'],
    ];
}