diff --git a/web/application/models/product/versionmodel.php b/web/application/models/product/versionmodel.php index d863a1bc..1ca228b0 100644 --- a/web/application/models/product/versionmodel.php +++ b/web/application/models/product/versionmodel.php @@ -45,11 +45,12 @@ function getBasicVersionInfo($productId,$date) and s.product_id = $productId and p.product_id = s.product_id and p.product_active=1 - and p.channel_active=1 + and p.channel_active=1 + and s.session >0 and p.version_active=1 and p.version_name=s.version_name group by p.version_name) t - right join + left join ( select distinct pp.version_name from ".$dwdb->dbprefix('dim_product')." pp where pp.product_id = $productId @@ -99,7 +100,24 @@ function getVersionData($fromTime,$toTime,$productid) from ".$dwdb->dbprefix('dim_product')." pp where pp.product_id =$productid and pp.product_active=1 and pp.channel_active=1 - and pp.version_active=1 + and pp.version_active=1 + and pp.version_name in (select + version_name + from + (select + sum(startusers), version_name + from + razor_sum_basic_product_version + where + date_sk in (select + date_sk + from + razor_dim_date + where + datevalue between '$fromTime' and '$toTime') + group by version_name + order by sum(startusers) desc + limit 10) rs) group by pp.version_name) p left join (select * from ".$dwdb->dbprefix('sum_basic_product_version')." @@ -232,4 +250,4 @@ function getNewAndActiveAllCount($productId,$from,$to) } -?> \ No newline at end of file +?>