@@ -17,40 +17,40 @@ public function aboutIndex() {
1717
1818 public function statisticsIndex () {
1919 //Общее количество статей
20- $ postsCount = Post::all ()->count ();
20+ // $postsCount = Post::all()->count();
2121
2222 //Общее количество новостей
23- $ newsCount = News::all ()->count ();
23+ // $newsCount = News::all()->count();
2424
2525 //ФИО автора, у которого больше всего статей на сайте
26- $ usersWithMostPosts = getUserWithMaxPosts ();
26+ // $usersWithMostPosts = getUserWithMaxPosts();
2727
2828 //Самая длинная статья - название, ссылка на статью и длина статьи в символах
29- $ theLongestPost = getTheLongestPosts ();
29+ // $theLongestPost = getTheLongestPosts();
3030
3131 //Самая короткая статья - название, ссылка на статью и длина статьи в символах
32- $ theShortestPost = getTheShortestPosts ();
32+ // $theShortestPost = getTheShortestPosts();
3333
3434 //Средние количество статей у “активных” пользователей, при этом активным пользователь считается, если у него есть более 1-й статьи
35- $ avgPostsHaveActiveUsers = getAveragePosts ();
35+ // $avgPostsHaveActiveUsers = getAveragePosts();
3636
3737 //Самая непостоянная - название, ссылка на статью, которую меняли больше всего раз
38- $ mostChangingPosts = getMostChangingPosts ();
38+ // $mostChangingPosts = getMostChangingPosts();
3939
4040 //Самая обсуждаемая статья - название, ссылка на статью, у которой больше всего комментариев.
41- $ mostCommentPosts = getMostCommentPosts ();
42-
43- $ statistics = [
44- 'posts_count ' => $ postsCount ,
45- 'news_count ' => $ newsCount ,
46- 'users_with_most_posts ' => $ usersWithMostPosts ,
47- 'the_longest_posts ' => $ theLongestPost ,
48- 'the_shortest_posts ' => $ theShortestPost ,
49- 'avg_posts_have_active_users ' => $ avgPostsHaveActiveUsers ,
50- 'most_changing_posts ' => $ mostChangingPosts ,
51- 'most_comment_posts ' => $ mostCommentPosts
52- ];
53-
54- return view ('static.statistics ' , ['statistics ' => $ statistics ]);
41+ // $mostCommentPosts = getMostCommentPosts();
42+
43+ // $statistics = [
44+ // 'posts_count' => $postsCount,
45+ // 'news_count' => $newsCount,
46+ // 'users_with_most_posts' => $usersWithMostPosts,
47+ // 'the_longest_posts' => $theLongestPost,
48+ // 'the_shortest_posts' => $theShortestPost,
49+ // 'avg_posts_have_active_users' => $avgPostsHaveActiveUsers,
50+ // 'most_changing_posts' => $mostChangingPosts,
51+ // 'most_comment_posts' => $mostCommentPosts
52+ // ];
53+
54+ // return view('static.statistics', ['statistics' => $statistics]);
5555 }
5656}
0 commit comments