增加通用结尾

This commit is contained in:
2023-06-27 00:58:27 +08:00
parent 839a8e4734
commit a12cca37e4
2 changed files with 13 additions and 1 deletions

View File

@@ -214,7 +214,7 @@ class Post extends Base
$list_post_category_id = $this->getAttr('categorys')->column('category_id'); $list_post_category_id = $this->getAttr('categorys')->column('category_id');
$list_start_post = Post::where('category_id', 'in', $list_post_category_id)->cache(600)->where('status', 1)->select(); $list_start_post = Post::where('category_id', 'in', $list_post_category_id)->where('type', 'category-start')->cache(600)->where('status', 1)->select();
foreach ($list_start_post as $k_start_post => $v_start_post) { foreach ($list_start_post as $k_start_post => $v_start_post) {
$start_content .= $v_start_post->content_html; $start_content .= $v_start_post->content_html;
@@ -222,4 +222,15 @@ class Post extends Base
return $start_content; return $start_content;
} }
public function getEndContentAttr()
{
$end_content = '';
$list_post_category_id = $this->getAttr('categorys')->column('category_id');
$list_end_post = Post::where('category_id', 'in', $list_post_category_id)->where('type', 'category-end')->cache(600)->where('status', 1)->select();
foreach ($list_end_post as $k_end_post => $v_end_post) {
$end_content.= $v_end_post->content_html;
}
return $end_content;
}
} }

View File

@@ -127,6 +127,7 @@
<article class="ul-content entry heti heti--classic"> <article class="ul-content entry heti heti--classic">
{$post->start_content|raw} {$post->start_content|raw}
{$post->content_html_show|raw} {$post->content_html_show|raw}
{$post->end_content|raw}
{:\\app\\common\\tools\\PostBlock::copyright($post)} {:\\app\\common\\tools\\PostBlock::copyright($post)}
</article> </article>