Thanks for update I did that but the issue is if some list have segment then result is wrong...
How to fix this segment issue , as segment have many operators and conditions...
If you could help me with YII query or SQL query, it would be great
@AHK - We already have defined functions to do this, have a look at apps/customer/components/behaviors/CampaignStatsProcessorBehavior.php Line 680.
If a campaign uses a segment, you can count the subscribers in that segment using $campaign->segment->countSubscribers()