@@ -271,7 +271,7 @@ component extends="app.Controllers.Controller" {
271271 private function getBlogsByAuthor (required authorId , numeric page = 1 , numeric perPage = 6 , boolean isInfiniteScroll = false ) {
272272 var result = {
273273 query = model (" Blog" ).findAll (
274- where = " statusid <> 1 AND status = 'Approved' AND isPublished IS TRUE AND createdBy = #authorId #" ,
274+ where = " statusid <> 1 AND status = 'Approved' AND isPublished = 1 AND createdBy = #authorId #" ,
275275 include = " User" ,
276276 order = " postDate DESC" ,
277277 page = arguments .page ,
@@ -282,7 +282,7 @@ component extends="app.Controllers.Controller" {
282282 };
283283
284284 result .totalCount = model (" Blog" ).count (
285- where = " statusid <> 1 AND status = 'Approved' AND isPublished IS TRUE AND createdBy = #authorId #"
285+ where = " statusid <> 1 AND status = 'Approved' AND isPublished = 1 AND createdBy = #authorId #"
286286 );
287287 result .hasMore = (page * perPage ) < result .totalCount ;
288288
@@ -324,7 +324,7 @@ component extends="app.Controllers.Controller" {
324324
325325 if (len (trim (searchTerm ))) {
326326 var query = model (" blog" ).findAll (
327- where = " status ='Approved' AND isPublished IS TRUE
327+ where = " status ='Approved' AND isPublished = 1
328328 AND (slug LIKE '%#searchTerm #%' OR title LIKE '%#searchTerm #%' OR content LIKE '%#searchTerm #%' OR fullname LIKE '%#searchTerm #%' OR email LIKE '%#searchTerm #%')" ,
329329 include = " User, PostStatus, PostType" ,
330330 order = " postDate DESC" ,
@@ -335,7 +335,7 @@ component extends="app.Controllers.Controller" {
335335 if (isInfiniteScroll ) {
336336 totalCount = model (" blog" ).count (
337337 include = " User, PostStatus, PostType" ,
338- where = " status ='Approved' AND isPublished IS TRUE
338+ where = " status ='Approved' AND isPublished = 1
339339 AND (slug LIKE '%#searchTerm #%' OR title LIKE '%#searchTerm #%' OR content LIKE '%#searchTerm #%' OR fullname LIKE '%#searchTerm #%' OR email LIKE '%#searchTerm #%')"
340340 );
341341 hasMore = (page * perPage ) < totalCount ;
@@ -363,7 +363,7 @@ component extends="app.Controllers.Controller" {
363363 }
364364 // Function to load categories for the blog list
365365 function categories () {
366- categorylist = model (" Category" ).findAll (where = " isActive IS TRUE " , cache = 60 );
366+ categorylist = model (" Category" ).findAll (where = " isActive = 1 " , cache = 60 );
367367 renderPartial (partial = " partials/categorylist" );
368368 }
369369
@@ -731,7 +731,7 @@ component extends="app.Controllers.Controller" {
731731 public function feed () {
732732 // Fetch all blogs
733733 blogPosts = model (" Blog" ).findAll (
734- where = " status = 'Approved' AND isPublished IS TRUE " ,
734+ where = " status = 'Approved' AND isPublished = 1 " ,
735735 include = " User" ,
736736 order = " postDate DESC" ,
737737 cache = 10
@@ -744,7 +744,7 @@ component extends="app.Controllers.Controller" {
744744 public function commentsFeed () {
745745 // Get recent comments with related blog post
746746 comments = model (" Comment" ).findAll (
747- where = " isPublished IS TRUE " ,
747+ where = " isPublished = 1 " ,
748748 include = " Blog" ,
749749 order = " createdAt DESC" ,
750750 limit = 20 ,
@@ -788,7 +788,7 @@ component extends="app.Controllers.Controller" {
788788 private function getAllBlogs (numeric page = 1 , numeric perPage = 6 , boolean isInfiniteScroll = false ) {
789789 var result = {
790790 query = model (" Blog" ).findAll (
791- where = " statusid <> 1 AND status = 'Approved' AND isPublished IS TRUE " ,
791+ where = " statusid <> 1 AND status = 'Approved' AND isPublished = 1 " ,
792792 include = " User" ,
793793 order = " postDate DESC" ,
794794 page = arguments .page ,
@@ -800,7 +800,7 @@ component extends="app.Controllers.Controller" {
800800 };
801801
802802 result .totalCount = model (" Blog" ).count (
803- where = " statusid <> 1 AND status = 'Approved' AND isPublished IS TRUE " ,
803+ where = " statusid <> 1 AND status = 'Approved' AND isPublished = 1 " ,
804804 cache = 5
805805 );
806806 result .hasMore = (page * perPage ) < result .totalCount ;
@@ -815,7 +815,7 @@ component extends="app.Controllers.Controller" {
815815
816816 var result = {
817817 query = model (" Blog" ).findAll (
818- where = " blog_posts.post_created_date BETWEEN '#startdate #' AND '#enddate #' AND blog_posts.status='Approved' AND blog_posts.isPublished IS TRUE " ,
818+ where = " blog_posts.post_created_date BETWEEN '#startdate #' AND '#enddate #' AND blog_posts.status='Approved' AND blog_posts.isPublished = 1 " ,
819819 order = " postCreatedDate DESC" ,
820820 include = " User" ,
821821 returnAs = " query" ,
@@ -827,7 +827,7 @@ component extends="app.Controllers.Controller" {
827827 };
828828
829829 result .totalCount = model (" Blog" ).count (
830- where = " blog_posts.post_created_date BETWEEN '#startdate #' AND '#enddate #' AND blog_posts.status='Approved' AND blog_posts.isPublished IS TRUE "
830+ where = " blog_posts.post_created_date BETWEEN '#startdate #' AND '#enddate #' AND blog_posts.status='Approved' AND blog_posts.isPublished = 1 "
831831 );
832832 result .hasMore = (page * perPage ) < result .totalCount ;
833833
@@ -850,7 +850,7 @@ component extends="app.Controllers.Controller" {
850850
851851 var result = {
852852 query = model (" Blog" ).findAll (
853- where = " id IN (#arrayToList (blogIds ) #) AND categoryId = '#category .id #' AND status ='Approved' AND isPublished IS TRUE " ,
853+ where = " id IN (#arrayToList (blogIds ) #) AND categoryId = '#category .id #' AND status ='Approved' AND isPublished = 1 " ,
854854 order = " createdAt DESC" ,
855855 include = " User,BlogCategory" ,
856856 returnAs = " query" ,
@@ -862,7 +862,7 @@ component extends="app.Controllers.Controller" {
862862 };
863863
864864 result .totalCount = model (" Blog" ).count (
865- where = " id IN (#arrayToList (blogIds ) #) AND categoryId = '#category .id #' AND status ='Approved' AND isPublished IS TRUE " ,
865+ where = " id IN (#arrayToList (blogIds ) #) AND categoryId = '#category .id #' AND status ='Approved' AND isPublished = 1 " ,
866866 include = " User,BlogCategory"
867867 );
868868 result .hasMore = (page * perPage ) < result .totalCount ;
@@ -874,7 +874,7 @@ component extends="app.Controllers.Controller" {
874874 private function getAllByTag (required string tag , numeric page = 1 , numeric perPage = 6 , boolean isInfiniteScroll = false ) {
875875 var result = {
876876 query = model (" Blog" ).findAll (
877- where = " name = '#tag #' AND status ='Approved' AND isPublished IS TRUE " ,
877+ where = " name = '#tag #' AND status ='Approved' AND isPublished = 1 " ,
878878 order = " createdAt DESC" ,
879879 include = " User,tag" ,
880880 returnAs = " query" ,
@@ -885,7 +885,7 @@ component extends="app.Controllers.Controller" {
885885 totalCount = 0
886886 };
887887
888- result .totalCount = model (" Blog" ).count (where = " name = '#tag #' AND status ='Approved' AND isPublished IS TRUE " , include = " User,tag" );
888+ result .totalCount = model (" Blog" ).count (where = " name = '#tag #' AND status ='Approved' AND isPublished = 1 " , include = " User,tag" );
889889 result .hasMore = (page * perPage ) < result .totalCount ;
890890
891891 return result ;
@@ -1250,7 +1250,7 @@ component extends="app.Controllers.Controller" {
12501250 }
12511251
12521252 function getAllCommentsByBlogid (required numeric id ) {
1253- var comments = model (" Comment" ).findAll (include = " User" , where = " isPublished IS TRUE AND blogid = '#arguments .id #' AND commentParentId ISNULL " , cache = 5 );
1253+ var comments = model (" Comment" ).findAll (include = " User" , where = " isPublished = 1 AND blogid = '#arguments .id #' AND commentParentId ISNULL " , cache = 5 );
12541254
12551255 return comments ;
12561256 }
@@ -1300,7 +1300,7 @@ component extends="app.Controllers.Controller" {
13001300 response = saveComment (params );
13011301 }
13021302 if (structKeyExists (response , " Id" )){
1303- comments = commentModel .findAll (include = " User" , where = " id ='#response .Id #' AND isPublished IS TRUE " );
1303+ comments = commentModel .findAll (include = " User" , where = " id ='#response .Id #' AND isPublished = 1 " );
13041304 renderPartial (partial = " partials/comment" );
13051305 }
13061306 } catch (any e ) {
0 commit comments