Skip to content
  • P
    Projects
  • G
    Groups
  • S
    Snippets
  • Help

孙龙 / note-library

  • This project
    • Loading...
  • Sign in
Go to a project
  • Project
  • Repository
  • Issues 0
  • Merge Requests 0
  • Pipelines
  • Wiki
  • Snippets
  • Settings
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Files
  • Commits
  • Branches
  • Tags
  • Contributors
  • Graph
  • Compare
  • Charts
Commit a88a7a4d authored 5 years ago by 孙龙's avatar 孙龙
Browse files
Options
  • _('Browse Files')
  • Download
  • Email Patches
  • Plain Diff

up

parent 9c29d7c3
Hide whitespace changes
Inline Side-by-side
Showing with 31 additions and 13 deletions
  • app/Http/Controllers/AjaxController.php
  • app/Http/Controllers/WebController.php
  • app/Model/TemplateListModel.php
  • public/js/web/labelList.js
  • resources/views/web/labelList.blade.php
app/Http/Controllers/AjaxController.php
View file @ a88a7a4d
......@@ -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");
......
This diff is collapsed. Click to expand it.
app/Http/Controllers/WebController.php
View file @ a88a7a4d
......@@ -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;
......
This diff is collapsed. Click to expand it.
app/Model/TemplateListModel.php
View file @ a88a7a4d
......@@ -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);
}
......
This diff is collapsed. Click to expand it.
public/js/web/labelList.js
View file @ a88a7a4d
......@@ -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: {
......
This diff is collapsed. Click to expand it.
resources/views/web/labelList.blade.php
View file @ a88a7a4d
......@@ -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">
......
This diff is collapsed. Click to expand it.
  • Write
  • Preview
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