コード例 #1
0
ファイル: MiscController.php プロジェクト: synthx/infuse
 /**
  * Show one blog post
  * GET
  *
  * @param int $id
  * @param string $title
  * @return Response
  */
 public function showBlog($id, $title)
 {
     $blog = BlogManager::find($id);
     $nextBlog = BlogManager::find($blog->id + 1);
     $prevBlog = BlogManager::find($blog->id - 1);
     $comments = BlogCommentManager::join('accounts', 'accounts.guid', '=', 'cms_blogs_comments.author')->where('blog_id', $blog->id)->orderBy('date', 'desc')->paginate(10);
     $countComments = BlogCommentManager::where('blog_id', $blog->id)->count();
     return view('home.blog', compact('blog', 'comments', 'nextBlog', 'prevBlog', 'countComments'));
 }
コード例 #2
0
 public function getCmt($cmt_for, $type)
 {
     return Comment::join('users', 'users.id', '=', 'comments.cmt_of')->where('cmt_for', $cmt_for)->where('typeCMT', $type)->select('comments.id as id', 'comments.cmt_of as cmt_of', 'users.name as name', 'comments.time as time', 'comments.content as content')->orderBy('id', 'desc')->get();
 }