feat: 增加平台信息跳转

This commit is contained in:
augushong
2025-10-05 14:28:46 +08:00
parent 9a0bd9b2b0
commit c17b69fcdf
4 changed files with 88 additions and 0 deletions

View File

@@ -4,6 +4,7 @@ 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;
@@ -76,6 +77,9 @@ class Post extends Common
$model_post->platform_status_title = ModelPost::LIST_POST_PLATFORM_STATUS[$model_post->platform_status];
}
$platform_data = item_post_platform($platform_type);
View::assign('platform_data', $platform_data);
View::assign('list', $list);
View::assign('platform_type', $platform_type);

View File

@@ -332,3 +332,16 @@ function list_post_platform()
return $list;
}
function item_post_platform($id)
{
$item = Nav::where('id', $id)->where('type', 12)->where('status',1)->cache(30)->find();
if (!empty($item)) {
$desc = $item->desc;
$desc_arr = explode(PHP_EOL, $desc);
$item->home_url = $desc_arr[0]?? '';
$item->account = $desc_arr[1]?? '';
}
return $item;
}