fixed a Matrix sql problem
This commit is contained in:
parent
6be6c0bb11
commit
36d401aa74
1 changed files with 12 additions and 16 deletions
|
|
@ -550,22 +550,20 @@ sub view {
|
|||
foreach my $category (keys %{$self->getCategories}) {
|
||||
my $data;
|
||||
my $sql = "
|
||||
select
|
||||
select
|
||||
assetData.title as productName,
|
||||
assetData.url,
|
||||
listing.assetId,
|
||||
rating.meanValue,
|
||||
rating.medianValue,
|
||||
rating.countValue
|
||||
from MatrixListing as listing
|
||||
left join asset on listing.assetId = asset.assetId
|
||||
left join MatrixListing_ratingSummary as rating on rating.listingId = listing.assetId
|
||||
left join assetData on assetData.assetId = listing.assetId and listing.revisionDate =
|
||||
assetData.revisionDate
|
||||
where
|
||||
asset.parentId=?
|
||||
and asset.state='published'
|
||||
and asset.className='WebGUI::Asset::MatrixListing'
|
||||
rating.listingId,
|
||||
rating.meanValue,
|
||||
asset.parentId
|
||||
from
|
||||
MatrixListing_ratingSummary as rating
|
||||
left join asset on (rating.listingId = asset.assetId)
|
||||
left join assetData on assetData.assetId = rating.listingId
|
||||
where
|
||||
rating.category =?
|
||||
and asset.parentId=?
|
||||
and asset.state='published'
|
||||
and assetData.revisionDate=(
|
||||
select
|
||||
max(revisionDate)
|
||||
|
|
@ -575,8 +573,6 @@ assetData.revisionDate
|
|||
assetData.assetId=asset.assetId
|
||||
and (status='approved' or status='archived')
|
||||
)
|
||||
and status='approved'
|
||||
and rating.category=?
|
||||
group by
|
||||
assetData.assetId
|
||||
order by rating.meanValue ";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue