mirror of https://github.com/1099438829/apeblog
修正文章删除和单页面
This commit is contained in:
parent
0450e84961
commit
0bd6676770
|
|
@ -2,9 +2,9 @@
|
||||||
|
|
||||||
namespace app\admin\controller;
|
namespace app\admin\controller;
|
||||||
|
|
||||||
|
use app\common\model\Document;
|
||||||
use app\common\model\Document as aModel;
|
use app\common\model\Document as aModel;
|
||||||
use app\common\model\DocumentCategory as cModel;
|
use app\common\model\DocumentCategory as cModel;
|
||||||
use app\common\model\DocumentPage;
|
|
||||||
use app\common\model\Tag as TagModel;
|
use app\common\model\Tag as TagModel;
|
||||||
use app\common\model\DocumentArticle;
|
use app\common\model\DocumentArticle;
|
||||||
use app\common\model\Comment as CommentModel;
|
use app\common\model\Comment as CommentModel;
|
||||||
|
|
@ -14,6 +14,7 @@ use think\db\exception\DataNotFoundException;
|
||||||
use think\db\exception\DbException;
|
use think\db\exception\DbException;
|
||||||
use think\db\exception\ModelNotFoundException;
|
use think\db\exception\ModelNotFoundException;
|
||||||
use think\Exception;
|
use think\Exception;
|
||||||
|
use think\facade\Db;
|
||||||
use think\facade\Log;
|
use think\facade\Log;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -24,6 +25,16 @@ use think\facade\Log;
|
||||||
*/
|
*/
|
||||||
class Article extends AuthController
|
class Article extends AuthController
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* 构造方法 初始化一些参数
|
||||||
|
*/
|
||||||
|
public function initialize()
|
||||||
|
{
|
||||||
|
parent::initialize();
|
||||||
|
//修正因为修改model名称和原来不能对应导致的model功能异常
|
||||||
|
$this->model = new Document();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 文章管理主页
|
* 文章管理主页
|
||||||
* @return string
|
* @return string
|
||||||
|
|
@ -53,6 +64,7 @@ class Article extends AuthController
|
||||||
['page', 1],
|
['page', 1],
|
||||||
['limit', 20],
|
['limit', 20],
|
||||||
]);
|
]);
|
||||||
|
$where['type'] = Document::DOCUMENT_TYPE_ARTICLE;
|
||||||
return app("json")->layui(aModel::systemPage($where));
|
return app("json")->layui(aModel::systemPage($where));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -70,7 +82,7 @@ class Article extends AuthController
|
||||||
['author', ''],
|
['author', ''],
|
||||||
['title', ''],
|
['title', ''],
|
||||||
['alias', ''],
|
['alias', ''],
|
||||||
['category_id', ''],
|
['category_id', 0],
|
||||||
['type', 'article'],
|
['type', 'article'],
|
||||||
['abstract', ''],
|
['abstract', ''],
|
||||||
['keywords', ''],
|
['keywords', ''],
|
||||||
|
|
@ -107,6 +119,8 @@ class Article extends AuthController
|
||||||
if ($data['is_hot']) $data['is_hot'] = 1;
|
if ($data['is_hot']) $data['is_hot'] = 1;
|
||||||
if ($data['display']) $data['display'] = 1;
|
if ($data['display']) $data['display'] = 1;
|
||||||
if ($data['is_top']) $data['is_top'] = 1;
|
if ($data['is_top']) $data['is_top'] = 1;
|
||||||
|
// 启动事务
|
||||||
|
Db::startTrans();
|
||||||
if ($id == "") {
|
if ($id == "") {
|
||||||
$data['uid'] = $this->adminInfo['uid'];
|
$data['uid'] = $this->adminInfo['uid'];
|
||||||
$data['author'] = $data['author'] ?: $this->adminInfo['nickname'];
|
$data['author'] = $data['author'] ?: $this->adminInfo['nickname'];
|
||||||
|
|
@ -147,11 +161,15 @@ class Article extends AuthController
|
||||||
$tagModel->createTags($data['tags'], $id, $this->adminId);
|
$tagModel->createTags($data['tags'], $id, $this->adminId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// 启动事务
|
||||||
|
Db::startTrans();
|
||||||
$res = true;
|
$res = true;
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
Log::error('文章修改失败:失败原因:' . $e->getMessage());
|
Log::error('文章修改失败:失败原因:' . $e->getMessage());
|
||||||
$error = $e->getMessage();
|
$error = $e->getMessage();
|
||||||
$res = false;
|
$res = false;
|
||||||
|
// 回滚事务
|
||||||
|
Db::rollback();
|
||||||
}
|
}
|
||||||
return $res ? app("json")->success("操作成功", 'code') : app("json")->fail("操作失败,错误原因:".$error);
|
return $res ? app("json")->success("操作成功", 'code') : app("json")->fail("操作失败,错误原因:".$error);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,18 +2,17 @@
|
||||||
|
|
||||||
namespace app\admin\controller;
|
namespace app\admin\controller;
|
||||||
|
|
||||||
|
use app\common\model\Document;
|
||||||
use app\common\model\Document as aModel;
|
use app\common\model\Document as aModel;
|
||||||
use app\common\model\DocumentCategory as cModel;
|
|
||||||
use app\common\model\DocumentPage;
|
use app\common\model\DocumentPage;
|
||||||
use app\common\model\Tag as TagModel;
|
use app\common\model\Tag as TagModel;
|
||||||
use app\common\model\DocumentArticle;
|
|
||||||
use app\common\model\Comment as CommentModel;
|
use app\common\model\Comment as CommentModel;
|
||||||
use app\Request;
|
|
||||||
use app\admin\extend\Util as Util;
|
use app\admin\extend\Util as Util;
|
||||||
use think\db\exception\DataNotFoundException;
|
use think\db\exception\DataNotFoundException;
|
||||||
use think\db\exception\DbException;
|
use think\db\exception\DbException;
|
||||||
use think\db\exception\ModelNotFoundException;
|
use think\db\exception\ModelNotFoundException;
|
||||||
use think\Exception;
|
use think\Exception;
|
||||||
|
use think\facade\Db;
|
||||||
use think\facade\Log;
|
use think\facade\Log;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -24,6 +23,17 @@ use think\facade\Log;
|
||||||
*/
|
*/
|
||||||
class Page extends AuthController
|
class Page extends AuthController
|
||||||
{
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 构造方法 初始化一些参数
|
||||||
|
*/
|
||||||
|
public function initialize()
|
||||||
|
{
|
||||||
|
parent::initialize();
|
||||||
|
//修正因为修改model名称和原来不能对应导致的model功能异常
|
||||||
|
$this->model = new Document();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 文章管理主页
|
* 文章管理主页
|
||||||
* @return string
|
* @return string
|
||||||
|
|
@ -71,10 +81,10 @@ class Page extends AuthController
|
||||||
['author', ''],
|
['author', ''],
|
||||||
['title', ''],
|
['title', ''],
|
||||||
['alias', ''],
|
['alias', ''],
|
||||||
['category_id', ''],
|
|
||||||
['type', 'page'],
|
['type', 'page'],
|
||||||
['abstract', ''],
|
['abstract', ''],
|
||||||
['keywords', ''],
|
['keywords', ''],
|
||||||
|
['category_id', 0],
|
||||||
['content', ''],
|
['content', ''],
|
||||||
['description', ''],
|
['description', ''],
|
||||||
['is_recommend', 0],
|
['is_recommend', 0],
|
||||||
|
|
@ -89,7 +99,6 @@ class Page extends AuthController
|
||||||
]);
|
]);
|
||||||
|
|
||||||
if ($data['title'] == "") return app("json")->fail("文章名称不能为空");
|
if ($data['title'] == "") return app("json")->fail("文章名称不能为空");
|
||||||
if ($data['category_id'] == "") return app("json")->fail("栏目分类不能为空");
|
|
||||||
if ($data['cover_path'] == "") return app("json")->fail("主图不能为空");
|
if ($data['cover_path'] == "") return app("json")->fail("主图不能为空");
|
||||||
$error = "";
|
$error = "";
|
||||||
try {
|
try {
|
||||||
|
|
@ -108,6 +117,8 @@ class Page extends AuthController
|
||||||
if ($data['is_hot']) $data['is_hot'] = 1;
|
if ($data['is_hot']) $data['is_hot'] = 1;
|
||||||
if ($data['display']) $data['display'] = 1;
|
if ($data['display']) $data['display'] = 1;
|
||||||
if ($data['is_top']) $data['is_top'] = 1;
|
if ($data['is_top']) $data['is_top'] = 1;
|
||||||
|
// 启动事务
|
||||||
|
Db::startTrans();
|
||||||
if ($id == "") {
|
if ($id == "") {
|
||||||
$data['uid'] = $this->adminInfo['uid'];
|
$data['uid'] = $this->adminInfo['uid'];
|
||||||
$data['author'] = $data['author'] ?: $this->adminInfo['nickname'];
|
$data['author'] = $data['author'] ?: $this->adminInfo['nickname'];
|
||||||
|
|
@ -120,7 +131,7 @@ class Page extends AuthController
|
||||||
'id' => $id,
|
'id' => $id,
|
||||||
'content' => $content
|
'content' => $content
|
||||||
];
|
];
|
||||||
DocumentArticle::insert($updateData);
|
DocumentPage::insert($updateData);
|
||||||
}
|
}
|
||||||
if (!empty($data['tags'])) {
|
if (!empty($data['tags'])) {
|
||||||
$tagModel = new TagModel();
|
$tagModel = new TagModel();
|
||||||
|
|
@ -131,16 +142,16 @@ class Page extends AuthController
|
||||||
if (!$ainfo) return app("json")->fail("数据不存在");
|
if (!$ainfo) return app("json")->fail("数据不存在");
|
||||||
aModel::where('id', $id)->save($data);
|
aModel::where('id', $id)->save($data);
|
||||||
if (!empty($content)) {
|
if (!empty($content)) {
|
||||||
$contentInfo = DocumentArticle::where('id', $id)->find();
|
$contentInfo = DocumentPage::where('id', $id)->find();
|
||||||
if (!$contentInfo) {
|
if (!$contentInfo) {
|
||||||
$updateData = [
|
$updateData = [
|
||||||
'id' => $id,
|
'id' => $id,
|
||||||
'content' => $content
|
'content' => $content
|
||||||
];
|
];
|
||||||
DocumentArticle::insert($updateData);
|
DocumentPage:insert($updateData);
|
||||||
} else {
|
} else {
|
||||||
//更新文档
|
//更新文档
|
||||||
DocumentArticle::where('id', $id)->save(['content' => $content]);
|
DocumentPage::where('id', $id)->save(['content' => $content]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!empty($data['tags'])) {
|
if (!empty($data['tags'])) {
|
||||||
|
|
@ -148,11 +159,15 @@ class Page extends AuthController
|
||||||
$tagModel->createTags($data['tags'], $id, $this->adminId);
|
$tagModel->createTags($data['tags'], $id, $this->adminId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// 启动事务
|
||||||
|
Db::startTrans();
|
||||||
$res = true;
|
$res = true;
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
Log::error('文章修改失败:失败原因:' . $e->getMessage());
|
Log::error('文章修改失败:失败原因:' . $e->getMessage());
|
||||||
$error = $e->getMessage();
|
$error = $e->getMessage();
|
||||||
$res = false;
|
$res = false;
|
||||||
|
// 回滚事务
|
||||||
|
Db::rollback();
|
||||||
}
|
}
|
||||||
return $res ? app("json")->success("操作成功", 'code') : app("json")->fail("操作失败,错误原因:".$error);
|
return $res ? app("json")->success("操作成功", 'code') : app("json")->fail("操作失败,错误原因:".$error);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -91,6 +91,9 @@
|
||||||
}, {
|
}, {
|
||||||
field: 'title',
|
field: 'title',
|
||||||
title: '标题'
|
title: '标题'
|
||||||
|
}, {
|
||||||
|
field: 'alias',
|
||||||
|
title: 'URL名称'
|
||||||
}, {
|
}, {
|
||||||
field: 'category_title',
|
field: 'category_title',
|
||||||
title: '分类',
|
title: '分类',
|
||||||
|
|
@ -202,7 +205,7 @@
|
||||||
text: '确认',
|
text: '确认',
|
||||||
btnClass: 'btn-danger',
|
btnClass: 'btn-danger',
|
||||||
action: function () {
|
action: function () {
|
||||||
$.post("/admin/admin_log/del", data = {id: id}, function (res) {
|
$.post("/admin/article/del", data = {id: id}, function (res) {
|
||||||
if (res.status == 200 || res.code == 200) lightyear.notify(res.msg, 'success', 3000, 'mdi mdi-emoticon-happy', 'top', 'center');
|
if (res.status == 200 || res.code == 200) lightyear.notify(res.msg, 'success', 3000, 'mdi mdi-emoticon-happy', 'top', 'center');
|
||||||
else lightyear.notify(res.msg, 'danger', 3000, 'mdi mdi-emoticon-neutral', 'top', 'center');
|
else lightyear.notify(res.msg, 'danger', 3000, 'mdi mdi-emoticon-neutral', 'top', 'center');
|
||||||
location.reload();
|
location.reload();
|
||||||
|
|
@ -234,7 +237,7 @@
|
||||||
text: '确认',
|
text: '确认',
|
||||||
btnClass: 'btn-danger',
|
btnClass: 'btn-danger',
|
||||||
action: function () {
|
action: function () {
|
||||||
$.post("/admin/admin_log/del", data = {id: checkID}, function (res) {
|
$.post("/admin/article/del", data = {id: checkID}, function (res) {
|
||||||
if (res.status == 200 || res.code == 200) {
|
if (res.status == 200 || res.code == 200) {
|
||||||
lightyear.notify(res.msg, 'success', 3000, 'mdi mdi-emoticon-happy', 'top', 'center');
|
lightyear.notify(res.msg, 'success', 3000, 'mdi mdi-emoticon-happy', 'top', 'center');
|
||||||
location.reload();
|
location.reload();
|
||||||
|
|
|
||||||
|
|
@ -12,12 +12,15 @@
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-lg-12">
|
<div class="col-lg-12">
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-body">
|
<div class="card-header">
|
||||||
<ul id="myTabs" class="nav nav-tabs" role="tablist">
|
<h4>基本信息</h4>
|
||||||
<li class="active"><a href="#home" id="home-tab" role="tab" data-toggle="tab">基本信息</a></li>
|
<ul class="card-actions">
|
||||||
<li class="tab-right"><a data-toggle="tooltip" data-original-title="返回" onclick="history.back(-1);return false;"><i class="mdi mdi-undo"></i></a></li>
|
<li>
|
||||||
|
<button type="button" data-toggle="tooltip" title="" data-original-title="返回" onclick="history.back(-1);return false;"><i class="mdi mdi-undo"></i></button>
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<div id="myTabContent" class="tab-content">
|
</div>
|
||||||
|
<div class="card-body">
|
||||||
<form action="#!" method="post" class="row add-form" onsubmit="return false;">
|
<form action="#!" method="post" class="row add-form" onsubmit="return false;">
|
||||||
<div class="form-group col-md-12">
|
<div class="form-group col-md-12">
|
||||||
<label>页面名称</label>
|
<label>页面名称</label>
|
||||||
|
|
@ -100,7 +103,6 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
{include file="public/footer"/}
|
{include file="public/footer"/}
|
||||||
<!--select2-->
|
<!--select2-->
|
||||||
<script type="text/javascript" src="/static/admin/js/select2.min.js"></script>
|
<script type="text/javascript" src="/static/admin/js/select2.min.js"></script>
|
||||||
|
|
@ -211,7 +213,7 @@
|
||||||
switch (item.name) {
|
switch (item.name) {
|
||||||
case 'title':
|
case 'title':
|
||||||
if (!item.value) {
|
if (!item.value) {
|
||||||
throw "页面名称不能为空";
|
throw "文章名称不能为空";
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'cover_path':
|
case 'cover_path':
|
||||||
|
|
@ -230,11 +232,11 @@
|
||||||
if (!checkResult) {
|
if (!checkResult) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$.post(url = "/admin/article/save", $('.add-form').serialize(), function (res) {
|
$.post(url = "/admin/page/save", $('.add-form').serialize(), function (res) {
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
lightyear.notify(res.msg, 'success', 3000, 'mdi mdi-emoticon-happy', 'top', 'center');
|
lightyear.notify(res.msg, 'success', 3000, 'mdi mdi-emoticon-happy', 'top', 'center');
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
location.href = '/admin/article/index';
|
location.href = '/admin/page/index';
|
||||||
}, 2000)
|
}, 2000)
|
||||||
} else lightyear.notify(res.msg, 'danger', 3000, 'mdi mdi-emoticon-happy', 'top', 'center');
|
} else lightyear.notify(res.msg, 'danger', 3000, 'mdi mdi-emoticon-happy', 'top', 'center');
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -12,12 +12,15 @@
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-lg-12">
|
<div class="col-lg-12">
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-body">
|
<div class="card-header">
|
||||||
<ul id="myTabs" class="nav nav-tabs" role="tablist">
|
<h4>基本信息</h4>
|
||||||
<li class="active"><a href="#home" id="home-tab" role="tab" data-toggle="tab">基本信息</a></li>
|
<ul class="card-actions">
|
||||||
<li class="tab-right"><a data-toggle="tooltip" data-original-title="返回" onclick="history.back(-1);return false;"><i class="mdi mdi-undo"></i></a></li>
|
<li>
|
||||||
|
<button type="button" data-toggle="tooltip" title="" data-original-title="返回" onclick="history.back(-1);return false;"><i class="mdi mdi-undo"></i></button>
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<div id="myTabContent" class="tab-content">
|
</div>
|
||||||
|
<div class="card-body">
|
||||||
<form action="#!" method="post" class="row add-form" onsubmit="return false;">
|
<form action="#!" method="post" class="row add-form" onsubmit="return false;">
|
||||||
<div class="form-group col-md-12">
|
<div class="form-group col-md-12">
|
||||||
<label>页面名称</label>
|
<label>页面名称</label>
|
||||||
|
|
@ -115,7 +118,6 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
{include file="public/footer"/}
|
{include file="public/footer"/}
|
||||||
<!--select2-->
|
<!--select2-->
|
||||||
<script type="text/javascript" src="/static/admin/js/select2.min.js"></script>
|
<script type="text/javascript" src="/static/admin/js/select2.min.js"></script>
|
||||||
|
|
@ -224,11 +226,6 @@
|
||||||
$.each(Arr, function (index, item) {
|
$.each(Arr, function (index, item) {
|
||||||
try {
|
try {
|
||||||
switch (item.name) {
|
switch (item.name) {
|
||||||
case 'category_id':
|
|
||||||
if (!item.value) {
|
|
||||||
throw "栏目分类不能为空";
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 'title':
|
case 'title':
|
||||||
if (!item.value) {
|
if (!item.value) {
|
||||||
throw "文章名称不能为空";
|
throw "文章名称不能为空";
|
||||||
|
|
@ -250,11 +247,11 @@
|
||||||
if (!checkResult) {
|
if (!checkResult) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$.post(url = "/admin/article/save", $('.add-form').serialize(), function (res) {
|
$.post(url = "/admin/page/save", $('.add-form').serialize(), function (res) {
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
lightyear.notify(res.msg, 'success', 3000, 'mdi mdi-emoticon-happy', 'top', 'center');
|
lightyear.notify(res.msg, 'success', 3000, 'mdi mdi-emoticon-happy', 'top', 'center');
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
location.href = '/admin/article/index';
|
location.href = '/admin/page/index';
|
||||||
}, 2000)
|
}, 2000)
|
||||||
} else lightyear.notify(res.msg, 'danger', 3000, 'mdi mdi-emoticon-happy', 'top', 'center');
|
} else lightyear.notify(res.msg, 'danger', 3000, 'mdi mdi-emoticon-happy', 'top', 'center');
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -202,7 +202,7 @@
|
||||||
text: '确认',
|
text: '确认',
|
||||||
btnClass: 'btn-danger',
|
btnClass: 'btn-danger',
|
||||||
action: function () {
|
action: function () {
|
||||||
$.post("/admin/admin_log/del", data = {id: id}, function (res) {
|
$.post("/admin/article/del", data = {id: id}, function (res) {
|
||||||
if (res.status == 200 || res.code == 200) lightyear.notify(res.msg, 'success', 3000, 'mdi mdi-emoticon-happy', 'top', 'center');
|
if (res.status == 200 || res.code == 200) lightyear.notify(res.msg, 'success', 3000, 'mdi mdi-emoticon-happy', 'top', 'center');
|
||||||
else lightyear.notify(res.msg, 'danger', 3000, 'mdi mdi-emoticon-neutral', 'top', 'center');
|
else lightyear.notify(res.msg, 'danger', 3000, 'mdi mdi-emoticon-neutral', 'top', 'center');
|
||||||
location.reload();
|
location.reload();
|
||||||
|
|
@ -234,7 +234,7 @@
|
||||||
text: '确认',
|
text: '确认',
|
||||||
btnClass: 'btn-danger',
|
btnClass: 'btn-danger',
|
||||||
action: function () {
|
action: function () {
|
||||||
$.post("/admin/admin_log/del", data = {id: checkID}, function (res) {
|
$.post("/admin/article/del", data = {id: checkID}, function (res) {
|
||||||
if (res.status == 200 || res.code == 200) {
|
if (res.status == 200 || res.code == 200) {
|
||||||
lightyear.notify(res.msg, 'success', 3000, 'mdi mdi-emoticon-happy', 'top', 'center');
|
lightyear.notify(res.msg, 'success', 3000, 'mdi mdi-emoticon-happy', 'top', 'center');
|
||||||
location.reload();
|
location.reload();
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,14 @@
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-lg-12">
|
<div class="col-lg-12">
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-header"><h4>{$tab.name}</h4></div>
|
<div class="card-header">
|
||||||
|
<h4>{$tab.name}</h4>
|
||||||
|
<ul class="card-actions">
|
||||||
|
<li>
|
||||||
|
<button type="button" data-toggle="tooltip" title="" data-original-title="返回" onclick="history.back(-1);return false;"><i class="mdi mdi-undo"></i></button>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<div id="toolbar" class="toolbar-btn-action">
|
<div id="toolbar" class="toolbar-btn-action">
|
||||||
<button id="btn_add" type="button" class="btn btn-primary m-r-5"
|
<button id="btn_add" type="button" class="btn btn-primary m-r-5"
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ class Document extends BaseModel
|
||||||
public static function systemPage($where): array
|
public static function systemPage($where): array
|
||||||
{
|
{
|
||||||
$model = new self;
|
$model = new self;
|
||||||
$model = $model->where("type", "=",$where['type']?:self::DOCUMENT_TYPE_ARTICLE);
|
$model = $model->where("type", "=",$where['type']??self::DOCUMENT_TYPE_ARTICLE);
|
||||||
if ($where['title'] != '') $model = $model->where("title", "like", "%$where[title]%");
|
if ($where['title'] != '') $model = $model->where("title", "like", "%$where[title]%");
|
||||||
if ($where['start_time'] != '') $model = $model->where("create_time", ">", strtotime($where['start_time'] . " 00:00:00"));
|
if ($where['start_time'] != '') $model = $model->where("create_time", ">", strtotime($where['start_time'] . " 00:00:00"));
|
||||||
if ($where['end_time'] != '') $model = $model->where("create_time", "<", strtotime($where['end_time'] . " 23:59:59"));
|
if ($where['end_time'] != '') $model = $model->where("create_time", "<", strtotime($where['end_time'] . " 23:59:59"));
|
||||||
|
|
|
||||||
|
|
@ -13,9 +13,9 @@ return [
|
||||||
// 磁盘类型
|
// 磁盘类型
|
||||||
'type' => 'local',
|
'type' => 'local',
|
||||||
// 磁盘路径
|
// 磁盘路径
|
||||||
'root' => app()->getRootPath() . 'public/storage',
|
'root' => app()->getRootPath() . 'public/upload',
|
||||||
// 磁盘路径对应的外部URL路径
|
// 磁盘路径对应的外部URL路径
|
||||||
'url' => '/storage',
|
'url' => '/upload',
|
||||||
// 可见性
|
// 可见性
|
||||||
'visibility' => 'public',
|
'visibility' => 'public',
|
||||||
],
|
],
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue