2021-07-26 17:41:59 +08:00

40 lines
1.1 KiB
PHP

<?php
/**
* @copyright Copyright (c) 2021 勾股工作室
* @license https://opensource.org/licenses/GPL-2.0
* @link https://www.gougucms.com
*/
namespace app\admin\validate;
use think\Validate;
class NavCheck extends Validate
{
protected $rule = [
'title' => 'require|unique:nav',
'name' => 'require|unique:nav',
'id' => 'require',
'status' => 'require',
'slide_id' => 'require',
];
protected $message = [
'title.require' => '标题不能为空',
'name.require' => '标识不能为空',
'title.unique' => '同样的记录已经存在!',
'name.unique' => '同样的记录已经存在!',
'id.require' => '缺少更新条件',
'status.require' => '状态为必选',
'slide_id.require' => '缺少导航组ID',
'filed.require' => '缺少要更新的字段名',
];
protected $scene = [
'add' => ['title', 'name', 'status'],
'edit' => ['id', 'title', 'name', 'status'],
'addInfo' => ['title', 'nav_id'],
'editInfo' => ['id', 'title'],
];
}