Query
Template:/var/www/socialcloudz/model/content/contentGateway.cfc
Execution Time (ms):58.5
Recordcount:0
Cached:No
Lazy:No
SQL:
select
c.memberid, c.contentid, c.dateCreated, c.private, c.download, c.comments, c.explicit, c.flagged,c.approved, c.parentID, c.views, c.featured, c.contentType, ifNull(c.publishdate, c.dateCreated) as publishdate,c.rating,c.ratingaverage,c.commentCount,c.isdeleted,
ct.linkID,ct.homelink,ct.type,ct.parentContentType,
sa.title, sa.desc, sa.creator,sa.image,sa.sortOrder,sa.startdate, sa.enddate, sa.subtitle,
'' as attribs, -- `contentstore`.`attributesByContentID`(c.contentID) as attribs,
'' as tags, -- `contentstore`.`tagsbycontentid`(c.contentID) as tags,
'' as categories, -- `contentstore`.`categoriesbycontentid`(c.contentID) as categories,
l.venue,l.city, l.state, l.country, l.latitude, l.longitude, l.zipcode,l.phone,l.address,
case ifnull(f.memberid,0) when 0 then 0 else 1 end as isFavorite,
'' as categoryID, -- `contentstore`.`categoryIDbycontentid`(c.contentID) as categoryID,
'' as childCount, -- `contentstore`.`childCountByContentID`(c.contentID) as childcount,
(select count(memberid) from favorites where contentID = c.contentID and level = 1) as favoritecount
from content c
inner join contenttype ct on ct.contentType = c.contentType
inner join standardattribs sa on sa.contentID = c.contentID
inner join community com on c.contentID = com.contentID
and (
com.communityID =218
or com.communityID in (select communityID from community.community where parentID = '218')
)
left join location l on l.contentID = c.contentID
left join favorites f on f.contentID = c.contentID and f.memberID = 0
left join attribs aConverted on aConverted.contentID = c.contentID and aConverted.keyname = 'converted'
where 1=1
and (private = 0
or (private = 1 and c.memberID in (0,0))
or (private =1 and 0 > 9)
)
and (publishdate is null or publishdate < {ts '2013-05-18 08:18:28'} or c.memberid = 0 or 0 > 9)
and c.contentType = 'Video' and c.contentid = 19958 and (aConverted.keyvalue = '1' or c.memberID = '0')
order by publishdate desc
limit 0, 10
memberidcontentiddateCreatedprivatedownloadcommentsexplicitflaggedapprovedparentIDviewsfeaturedcontentTypepublishdateratingratingaveragecommentCountisdeletedlinkIDhomelinktypeparentContentTypetitledesccreatorimagesortOrderstartdateenddatesubtitleattribstagscategoriesvenuecitystatecountrylatitudelongitudezipcodephoneaddressisFavoritecategoryIDchildCountfavoritecount
stringwtf