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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user