Commit a88a7a4d by 孙龙

up

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