内容模型功能完成
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<select class="form-control" name="{$name}" id="{$name}" style="width:auto;">
|
||||
{volist name="option" id="item"}
|
||||
<option value="{$item['key']}" {if $item['key'] == $value}selected{/if}>{$item['label']}</option>
|
||||
<option value="{$item['key']}" {if $item['key'] == $value}selected{/if}>{$item['label']|raw}</option>
|
||||
{/volist}
|
||||
</select>
|
||||
@@ -0,0 +1,5 @@
|
||||
<select class="form-control" name="{$name}" id="{$name}" style="width:auto;">
|
||||
{volist name="option" id="item"}
|
||||
<option value="{$item['key']}" {if $item['key'] == $value}selected{/if}>{$item['label']|raw}</option>
|
||||
{/volist}
|
||||
</select>
|
||||
0
app/http/form/template/kanban.html
Normal file
0
app/http/form/template/kanban.html
Normal file
6
app/http/form/template/radio.html
Normal file
6
app/http/form/template/radio.html
Normal file
@@ -0,0 +1,6 @@
|
||||
{volist name="option" id="item"}
|
||||
<div class="checkbox-nice checkbox-inline">
|
||||
<input type="radio" name="{$name}[]" id="{$name}-{$key}" value="{$key}" {if in_array($key, $value)}checked{/if}/>
|
||||
<label for="{$name}-{$key}">{$item}</label>
|
||||
</div>
|
||||
{/volist}
|
||||
@@ -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