mirror of
https://gitee.com/ulthon/ulthon_information.git
synced 2026-03-04 00:24:29 +08:00
feat: 增加平台信息跳转
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user