feat: 开始平台导出查询

This commit is contained in:
augushong
2025-05-05 10:59:21 +08:00
parent 669c7c3b77
commit bf2af3a4b7
5 changed files with 159 additions and 27 deletions

View File

@@ -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);

View File

@@ -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();
}