内容模型功能完成
This commit is contained in:
@@ -22,6 +22,13 @@ class Content extends Validate{
|
||||
$param = Request::param();
|
||||
$map = [];
|
||||
|
||||
$map[] = ['model_id', '=', $param['model_id']];
|
||||
if ($param['function'] == 'add') {
|
||||
$map[] = ['is_show', 'IN', [1, 2]];
|
||||
}else if ($param['function'] == 'edit') {
|
||||
$map[] = ['is_show', 'IN', [1, 3]];
|
||||
}
|
||||
|
||||
$attr = Attribute::where($map)->select();
|
||||
$rule = [];
|
||||
$message = [];
|
||||
|
||||
33
app/http/validate/Model.php
Normal file
33
app/http/validate/Model.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | SentCMS [ WE CAN DO IT JUST THINK IT ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2013 http://www.tensent.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: molong <molong@tensent.cn> <http://www.tensent.cn>
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\http\validate;
|
||||
|
||||
use think\Validate;
|
||||
|
||||
/**
|
||||
* 菜单验证
|
||||
*/
|
||||
class Model extends Validate{
|
||||
protected $rule = [
|
||||
'title' => 'require',
|
||||
'name' => 'require|unique:Model|alpha',
|
||||
];
|
||||
|
||||
protected $message = [
|
||||
'title.require' => '模型名称必须',
|
||||
'name.require' => '模型标识必须',
|
||||
'name.unique' => '模型标识已存在',
|
||||
'name.alpha' => '模型标识必须为字母',
|
||||
];
|
||||
|
||||
protected $scene = [
|
||||
'adminadd' => ['title', 'name'],
|
||||
'adminedit' => ['title'],
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user