[SOLVED] How to create a list showing active members only

6 years 8 months ago - 6 years 8 months ago #296271 by autobahn
The standard CB Members List shows everyone who has had a CBSubs subscription whether or not it is active (i.e. it includes expired subscriptions). Is there a way I can just have active subscriptions on a CB list?

Please Log in to join the conversation.

6 years 8 months ago - 6 years 8 months ago #296273 by krileon
Yes, see the below topic regarding this.

www.joomlapolis.com/forum/277-cb-paid-subscriptions-support/234684-solved-cbsubs-invoices-for-single-payments-using-the-offline-engine#285702

The userlist advanced filter queries are as follows.

Active Plans:
( ( SELECT COUNT(*) FROM `#__cbsubs_subscriptions` AS sub WHERE sub.`user_id` = u.`id` AND sub.`status` = 'A' ) >= 1 )

Expired Plans:
( ( SELECT COUNT(*) FROM `#__cbsubs_subscriptions` AS sub WHERE sub.`user_id` = u.`id` AND sub.`status` = 'X' ) >= 1 )

If you need it to check for a specific plan you'll need to adjust the query as needed.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
The following user(s) said Thank You: autobahn

Please Log in to join the conversation.

6 years 8 months ago #296278 by autobahn
Brilliant. Thank you so much.
The following user(s) said Thank You: krileon

Please Log in to join the conversation.

5 years 4 months ago #309059 by ThePiston
Replied by ThePiston on topic How to create a list showing active members only
these queries also present users who are active in an unpublished Plan, so be careful of that

CB 2.3, CBsubs 4.3, PHP 7.1, J! 3.9.X

Please Log in to join the conversation.

5 years 4 months ago #309060 by krileon
You can join the _cbsubs_plans table to the subquery and check for plan publish state if you like. It's entirely up to you. The advanced filter just extends the userlist query with your own SQL.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.188 seconds

Facebook Twitter LinkedIn