add more tests to cover AssetLineage->getChildCount. Optimize the new SQL query in getChildCount
This commit is contained in:
parent
0799d70428
commit
80333b1141
2 changed files with 12 additions and 2 deletions
|
|
@ -187,7 +187,7 @@ sub getChildCount {
|
|||
my $self = shift;
|
||||
my $opts = shift || {};
|
||||
my $stateWhere = $opts->{includeTrash} ? '' : "asset.state='published' and";
|
||||
my ($count) = $self->session->db->quickArray("select count(asset.state) from asset, assetData where asset.assetId=assetData.assetId and $stateWhere parentId=? and assetData.status in ('approved', 'archived')", [$self->getId]);
|
||||
my ($count) = $self->session->db->quickArray("select count(*) from asset, assetData where asset.assetId=assetData.assetId and $stateWhere parentId=? and assetData.status in ('approved', 'archived')", [$self->getId]);
|
||||
return $count;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue