后台内容模块功能完善

This commit is contained in:
2020-03-31 16:17:45 +08:00
parent de73484cca
commit 85d33da0d4
24 changed files with 386 additions and 251 deletions

View File

@@ -0,0 +1,47 @@
<?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;
use think\facade\Request;
use app\model\Attribute;
/**
* 菜单验证
*/
class Content extends Validate{
public function __construct(){
parent::__construct();
$param = Request::param();
$map = [];
$attr = Attribute::where($map)->select();
$rule = [];
$message = [];
$field = [];
foreach ($attr as $value) {
if ($value['is_must']) {
$rule[$value['name']] = 'require';
$message[$value['name'].'.require'] = $value['title'] . '不能为空!';
$field[] = $value['name'];
}
}
$this->rule = $rule;
$this->message = $message;
$this->scene = [
'adminadd' => $field,
'adminedit' => $field,
'useradd' => $field,
'useredit' => $field,
];
}
}