mirror of
https://gitee.com/ulthon/ulthon_information.git
synced 2026-03-03 16:24:28 +08:00
优化记录存储
This commit is contained in:
@@ -27,13 +27,7 @@ class Post extends Base
|
||||
public const CACHE_KEY_HITS = 'cache_hits_';
|
||||
|
||||
public static $autoClearCache = [
|
||||
[
|
||||
'name' => 'top_post'
|
||||
],
|
||||
[
|
||||
'type' => 'tag',
|
||||
'name' => 'page_cache'
|
||||
],
|
||||
|
||||
];
|
||||
|
||||
public static $stausNameList = [
|
||||
@@ -217,7 +211,7 @@ class Post extends Base
|
||||
|
||||
$list_post_category_id = $this->getAttr('categorys')->column('category_id');
|
||||
|
||||
$list_start_post = Post::where('category_id', 'in', $list_post_category_id)->where('type', 'category-start')->cache(600)->where('status', 1)->select();
|
||||
$list_start_post = Post::where('category_id', 'in', $list_post_category_id)->where('type', 'category-start')->cacheAlways(600)->where('status', 1)->select();
|
||||
|
||||
foreach ($list_start_post as $k_start_post => $v_start_post) {
|
||||
$start_content .= $v_start_post->content_html;
|
||||
@@ -230,7 +224,7 @@ class Post extends Base
|
||||
{
|
||||
$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();
|
||||
$list_end_post = Post::where('category_id', 'in', $list_post_category_id)->where('type', 'category-end')->cacheAlways(600)->where('status', 1)->select();
|
||||
foreach ($list_end_post as $k_end_post => $v_end_post) {
|
||||
$end_content.= $v_end_post->content_html;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user