mirror of
https://gitee.com/ulthon/ulthon_information.git
synced 2026-03-03 16:24:28 +08:00
新增文章统计;新增浏览文章查看
This commit is contained in:
@@ -44,8 +44,8 @@ class Common extends BaseController
|
||||
$top_posts = Post::where('is_top', 1)->limit(8)->where('type', 3)->cacheAlways('top_post')->select();
|
||||
View::assign('top_posts', $top_posts);
|
||||
|
||||
$list_site_last_visit = PostVisit::order('id desc')
|
||||
->group('ip,uid')
|
||||
$list_site_last_visit = PostVisit::with(['post'])->order('id desc')
|
||||
->group('post_id,ip,uid')
|
||||
->limit(6)
|
||||
->cache(60)
|
||||
->select();
|
||||
@@ -59,6 +59,12 @@ class Common extends BaseController
|
||||
View::assign('total_week_hits', $total_week_hits);
|
||||
View::assign('total_day_hits', $total_day_hits);
|
||||
|
||||
$total_post_count = Post::cache(60)->where('status', 1)->where('type', 3)->count();
|
||||
View::assign('total_post_count', $total_post_count);
|
||||
|
||||
$total_month_post_count = Post::cache(60)->where('status', 1)->where('type', 3)->where('publish_time', '>', strtotime(date('Y-m-1 00:00:00')))->count();
|
||||
View::assign('total_month_post_count', $total_month_post_count);
|
||||
|
||||
$this->userHubLogin();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user