Commit a88a7a4d by 孙龙

up

parent 9c29d7c3
......@@ -30,11 +30,12 @@ Class AjaxController extends Controller
$status = $request->input("status",'all');
$begin_time = $request->input("begin_time",'');
$end_time = $request->input("end_time",'');
$userType = $request->input("userType",0);//1只显示系统模板
$admin_id = $request->user->userId;
$perm = new PermController;
// 用户角色
$role = $perm->getUserRole($request);
$query = TemplateListModel::select('*')->CreateUserId($admin_id,$role,$create_username)->TemplateName($template_name)
$query = TemplateListModel::select('*')->CreateUserId($admin_id,$role,$create_username,$userType)->TemplateName($template_name)
->Status($status)
->SearchTime($begin_time,$end_time)
->OrderBy("id","desc");
......
......@@ -73,10 +73,21 @@ class WebController extends Controller
// 模板列表
public function labelList($request, $info)
{
$info['title'] = '标签模板列表';
$info['title'] = '我的标签模板列表';
return view('web', $info);
}
// 模板列表
public function systemlabelList($request, $info)
{
$info['title'] = '系统内置标签模板列表';
$info['id']= "labelList";
$info["labelListSystem"] = 1;
return view('web', $info);
}
// 标签使用记录
public function record($request, $info)
{
......@@ -108,14 +119,14 @@ class WebController extends Controller
public function showTemplate($request,$info){
$info['title'] = '预览';
$id = $request->input("t_id",0);
$count = TemplateListModel::where("id",intval($id))->where("create_userid",$request->user->userId)->count("id");
if($count <= 0){
return back()->with('showTemplateerror', '没找到属于您的模板信息');
}
// $count = TemplateListModel::where("id",intval($id))->where("create_userid",$request->user->userId)->count("id");
// if($count <= 0){
// return back()->with('showTemplateerror', '没找到属于您的模板信息');
// }
$templateInfo = TemplateListModel::where("id",intval($id))->select("id","template_name","status")->first();
if($templateInfo->status <= 0){
return back()->with('showTemplateerror', '该模板已经被主人禁用了');
}
// if($templateInfo->status <= 0){
// return back()->with('showTemplateerror', '该模板已经被主人禁用了');
// }
// dump($templateInfo->template_extend);
$html = $templateInfo->template_extend;
......
......@@ -58,7 +58,10 @@ class TemplateListModel extends Model{
return $query;
}
public function scopeCreateUserId($query,$create_userid=0,$role=null,$create_username=''){
public function scopeCreateUserId($query,$create_userid=0,$role=null,$create_username='',$userType=0){
if($userType == 1){
return $query->where('create_userid',1000);
}
if($create_userid && $role != 1){
$query = $query->where('create_userid',$create_userid);
}
......
......@@ -18,7 +18,7 @@ layui.use(['form', 'table', 'laydate'], function(){
,cellMinWidth: 80 //全局定义常规单元格的最小宽度
,page: true //开启分页
,where: {
model_id: $('input[name=model_id]').val()
userType: $('input[name=labelListSystem]').val(),
}
,cols: [[ //表头
{title: 'ID',field:"id",fixed: 'left', width: 80}
......@@ -36,7 +36,7 @@ layui.use(['form', 'table', 'laydate'], function(){
form.on('submit(load)', function(data) {
console.log(data)
//console.log(data)
//执行重载
table.reload('list', {
page: {
......
......@@ -3,6 +3,8 @@
{{ session('showTemplateerror') }}
</div>
@endif
@if(!isset($labelListSystem))
<form class="layui-form layui-box" method="post">
<div class="layui-form-item">
<div class="layui-inline">
......@@ -49,7 +51,8 @@
</div>
</div>
</form>
@endif
<input type="hidden" name="labelListSystem" value="{{ isset($labelListSystem)?$labelListSystem:0 }}" />
<table id="list" lay-filter="list"></table>
<script type="text/html" id="action">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment