AdminVehicleValidate.php 2.0 KB
<?php
// +----------------------------------------------------------------------
// | bronet [ 以客户为中心 以奋斗者为本 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013-2017 http://www.bronet.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 小夏 < 449134904@qq.com>
// +----------------------------------------------------------------------
namespace app\portal\validate;

use think\Validate;

class AdminVehicleValidate extends Validate
{
    protected $rule = [
        'cate_id' => 'require',
        'name' => 'require',
        'content' => 'require',
        'money' => ['require','float'],
        'type' => 'require',
        'stock' => ['require','integer'],
        'rend_money' => ['require','float'],
        'status' => 'require',
        'pic' => 'require',
        'pic_banner' => 'require',

    ];
    protected $message = [
        'cate_id.require' => '请指定商品分类!',
        'name.require' => '商品名不能为空!',
        'content.require' => '商品详情不能为空!',
        'money.require' => '商品价格不能为空!',
        'money.float' => '商品价格只能是数字!',
        'type.require' => '请选择商品类型!',
        'stock.require' => '总库存不能为空!',
        'stock.integer' => '总库存为整数!',
        'rend_money.require' => '押金不能为空!',
        'rend_money.float' => '押金只能是数字!',
        'status.require' => '商品状态不能为空!',
        'pic.require' => '商品缩略图不能为空!',
        'pic_banner.require' => '商品图片轮播不能为空!',

    ];

    protected $scene = [
        'buy'  => ['cate_id','name','pic','pic_banner','content','type','stock','money'],
        'rent'  => ['cate_id','name','pic','pic_banner','content','type','stock','rend_money'],
    ];
}