mirror of
https://gitee.com/ulthon/ulthon_information.git
synced 2026-03-03 16:24:28 +08:00
feat: 开始平台导出查询
This commit is contained in:
@@ -4,7 +4,6 @@ declare(strict_types=1);
|
||||
|
||||
namespace app\admin\controller;
|
||||
|
||||
use app\model\Nav;
|
||||
use app\model\Post as ModelPost;
|
||||
use app\model\PostCategory;
|
||||
use app\model\PostTag;
|
||||
@@ -43,6 +42,21 @@ class Post extends Common
|
||||
return View::fetch();
|
||||
}
|
||||
|
||||
public function indexOutput()
|
||||
{
|
||||
$model_list = ModelPost::with(['categorys.category', 'tags.tag'])
|
||||
->where('type', $this->request->param('type', 1))
|
||||
->order('id desc');
|
||||
|
||||
$list = $model_list->paginate([
|
||||
'query' => $this->request->get(),
|
||||
]);
|
||||
|
||||
View::assign('list', $list);
|
||||
|
||||
return View::fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示创建资源表单页.
|
||||
*
|
||||
@@ -151,7 +165,7 @@ class Post extends Common
|
||||
public function output($id)
|
||||
{
|
||||
$model_post = ModelPost::find($id);
|
||||
$list_post_platform = Nav::where('type', 12)->order('sort asc')->select();
|
||||
$list_post_platform = list_post_platform();
|
||||
|
||||
foreach ($list_post_platform as $model_platform) {
|
||||
$platform_info = explode("\n", $model_platform->desc);
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
use app\model\Admin;
|
||||
use app\model\AdminPermission;
|
||||
use app\model\Nav;
|
||||
use app\model\SystemConfig;
|
||||
use app\model\UploadFiles;
|
||||
use League\Flysystem\Util\MimeType;
|
||||
@@ -317,3 +318,8 @@ function show_time_ago($timestamp)
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
function list_post_platform()
|
||||
{
|
||||
return Nav::where('type', 12)->order('sort asc')->cache(30)->select();
|
||||
}
|
||||
|
||||
@@ -3,10 +3,7 @@
|
||||
<div class="layui-side layui-bg-black">
|
||||
<div class="layui-side-scroll">
|
||||
<!-- 左侧导航区域(可配合layui已有的垂直导航) -->
|
||||
<ul
|
||||
class="layui-nav layui-nav-tree"
|
||||
lay-filter="test"
|
||||
>
|
||||
<ul class="layui-nav layui-nav-tree">
|
||||
<li
|
||||
class="layui-nav-item layui-nav-itemed left-nav-item"
|
||||
data-name="post-{$Request.param.type|default='1'}"
|
||||
@@ -44,29 +41,22 @@
|
||||
>评论管理</a>
|
||||
</li>
|
||||
</ul>
|
||||
<ul
|
||||
class="layui-nav layui-nav-tree"
|
||||
lay-filter="test"
|
||||
>
|
||||
<ul class="layui-nav layui-nav-tree">
|
||||
<li class="layui-nav-item layui-nav-itemed">
|
||||
<a
|
||||
class=""
|
||||
href="javascript:;"
|
||||
>三方平台</a>
|
||||
<dl class="layui-nav-child">
|
||||
<dd
|
||||
class="left-nav-item"
|
||||
data-name="pc-nav-10"
|
||||
>
|
||||
<a href="{:url('Nav/index',['type'=>11,'show_target'=>1])}">头部导航</a>
|
||||
</dd>
|
||||
<dd
|
||||
class="left-nav-item"
|
||||
data-name="pc-nav-6"
|
||||
>
|
||||
<a href="{:url('Nav/index',['type'=>8,'show_img'=>0,'show_target'=>1])}">更多导航</a>
|
||||
</dd>
|
||||
{volist name=':list_post_platform()' id='vo'}
|
||||
|
||||
<dd
|
||||
class="left-nav-item"
|
||||
data-name="output-platform-type-{$vo.id}"
|
||||
>
|
||||
<a href="{:url('Post/indexOutput',['platform_type'=>$vo.id,'type'=>$Request.param.type])}">{$vo.title}</a>
|
||||
</dd>
|
||||
{/volist}
|
||||
</dl>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -79,10 +69,7 @@
|
||||
<div class="layui-side layui-bg-black">
|
||||
<div class="layui-side-scroll">
|
||||
<!-- 左侧导航区域(可配合layui已有的垂直导航) -->
|
||||
<ul
|
||||
class="layui-nav layui-nav-tree"
|
||||
lay-filter="test"
|
||||
>
|
||||
<ul class="layui-nav layui-nav-tree">
|
||||
<li
|
||||
class="layui-nav-item layui-nav-itemed left-nav-item"
|
||||
data-name="post-{$Request.param.type|default='1'}"
|
||||
|
||||
125
view/admin/post/index_output.html
Normal file
125
view/admin/post/index_output.html
Normal file
@@ -0,0 +1,125 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta
|
||||
name="viewport"
|
||||
content="width=device-width, initial-scale=1.0"
|
||||
>
|
||||
<meta
|
||||
http-equiv="X-UA-Compatible"
|
||||
content="ie=edge"
|
||||
>
|
||||
<title>内容管理</title>
|
||||
{include file="common/_require"}
|
||||
|
||||
<script>
|
||||
var currentHeaderNavItem = 'Post-{$Request.param.type|default="1"}';
|
||||
var currentLeftNavItem = 'output-platform-type-{$Request.param.platform_type|default="1"}';
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body class="layui-layout-body">
|
||||
|
||||
<div class="layui-layout layui-layout-admin">
|
||||
{include file="common/_header"}
|
||||
{include file="common/left_post"}
|
||||
|
||||
<div class="layui-body">
|
||||
|
||||
<div style="padding:15px">
|
||||
<div class="main-header">
|
||||
<span class="layui-breadcrumb">
|
||||
<a>首页</a>
|
||||
<a><cite>系统信息</cite></a>
|
||||
</span>
|
||||
</div>
|
||||
<div class="main-container">
|
||||
<div>
|
||||
<a
|
||||
href="{:url('create',['type'=>$Request.param.type,'category_id'=>$Request.param.category_id])}"
|
||||
class="layui-btn"
|
||||
>添加</a>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<table
|
||||
class="layui-table"
|
||||
lay-skin="line"
|
||||
>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>名称</th>
|
||||
<th>封面</th>
|
||||
<th>简介</th>
|
||||
<th>排序</th>
|
||||
<th>状态</th>
|
||||
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{volist name='list' id='vo'}
|
||||
|
||||
<tr
|
||||
class="item"
|
||||
data-id="{$vo.id}"
|
||||
>
|
||||
<td>{$vo.id}</td>
|
||||
<td style="max-width: 160px;">{$vo.title}</td>
|
||||
|
||||
<td><img
|
||||
src="{$vo.poster}"
|
||||
alt=""
|
||||
></td>
|
||||
<td style="max-width: 200px;">{$vo.desc_short}</td>
|
||||
<td>{$vo.sort}</td>
|
||||
<td>{$vo.status_name}</td>
|
||||
|
||||
<td>
|
||||
<div class="layui-btn-container">
|
||||
|
||||
<a
|
||||
class="layui-btn layui-btn-sm"
|
||||
target="_blank"
|
||||
href="{:url('output',['id'=>$vo.id,'type'=>$Request.param.type])}"
|
||||
>导出</a>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{/volist}
|
||||
{if condition="count($list) == 0" }
|
||||
<tr>
|
||||
<td colspan="7">暂无数据</td>
|
||||
</tr>
|
||||
{/if}
|
||||
</tbody>
|
||||
</table>
|
||||
<div>
|
||||
{$list|raw}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{include file="common/_footer"}
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$('.delete').click(function () {
|
||||
var item = this;
|
||||
layer.confirm('确定要删除吗?', function () {
|
||||
$.get('{:url("delete")}', {
|
||||
id: $(item).parents('.item').data('id')
|
||||
}, function (result) {
|
||||
layer.msg('删除成功');
|
||||
|
||||
$(item).parents('.item').remove();
|
||||
});
|
||||
});
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -154,7 +154,7 @@
|
||||
<hr>
|
||||
|
||||
<div class="post-platform-list">
|
||||
{volist name='list_post_platform' id='vo'}
|
||||
{volist name=':list_post_platform()' id='vo'}
|
||||
<div class="post-platform-item">
|
||||
<div
|
||||
class="post-platform-label"
|
||||
|
||||
Reference in New Issue
Block a user