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}) {
|
foreach my $category (keys %{$self->getCategories}) {
|
||||||
my $data;
|
my $data;
|
||||||
my $sql = "
|
my $sql = "
|
||||||
select
|
select
|
||||||
assetData.title as productName,
|
assetData.title as productName,
|
||||||
assetData.url,
|
assetData.url,
|
||||||
listing.assetId,
|
rating.listingId,
|
||||||
rating.meanValue,
|
rating.meanValue,
|
||||||
rating.medianValue,
|
asset.parentId
|
||||||
rating.countValue
|
from
|
||||||
from MatrixListing as listing
|
MatrixListing_ratingSummary as rating
|
||||||
left join asset on listing.assetId = asset.assetId
|
left join asset on (rating.listingId = asset.assetId)
|
||||||
left join MatrixListing_ratingSummary as rating on rating.listingId = listing.assetId
|
left join assetData on assetData.assetId = rating.listingId
|
||||||
left join assetData on assetData.assetId = listing.assetId and listing.revisionDate =
|
where
|
||||||
assetData.revisionDate
|
rating.category =?
|
||||||
where
|
and asset.parentId=?
|
||||||
asset.parentId=?
|
and asset.state='published'
|
||||||
and asset.state='published'
|
|
||||||
and asset.className='WebGUI::Asset::MatrixListing'
|
|
||||||
and assetData.revisionDate=(
|
and assetData.revisionDate=(
|
||||||
select
|
select
|
||||||
max(revisionDate)
|
max(revisionDate)
|
||||||
|
|
@ -575,8 +573,6 @@ assetData.revisionDate
|
||||||
assetData.assetId=asset.assetId
|
assetData.assetId=asset.assetId
|
||||||
and (status='approved' or status='archived')
|
and (status='approved' or status='archived')
|
||||||
)
|
)
|
||||||
and status='approved'
|
|
||||||
and rating.category=?
|
|
||||||
group by
|
group by
|
||||||
assetData.assetId
|
assetData.assetId
|
||||||
order by rating.meanValue ";
|
order by rating.meanValue ";
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue