Please Log in or Create an account to join the conversation.
peterbatchelor wrote: I'm implementing the "Coupon Generation for Family Plan Subscription" described in www.joomlapolis.com/support/tutorials/107-use-cases/18407-purchasing-discount-coupons
This is being done for a teaching association, where the "parent" subscriber wants to know who has used the coupons.
The code below lets them see the user IDs of people who have used the coupons, but not their names.
SELECT p.`coupon_code`, p.`max_uses_total`, ( SELECT COUNT(*) FROM `#__cbsubs_promotions_uses` AS c WHERE c.`promotion_id` = p.`id` ) AS count, ( SELECT group_concat(d.`user_id` separator ', ') FROM `#__cbsubs_promotions_uses` AS d WHERE d.`promotion_id` = p.`id` ) AS idlist FROM `#__cbsubs_promotions` AS p WHERE p.`coupon_code` REGEXP '^[user_id]-'
How can I change this code to get the table to show either the coupon user's name (I guess from users) or the "name" info from cbsubs_promotions (which is probably better as it includes their name, email address and subscription date)?
Thanks, Peter
(Community Builder 1.9.1, CBSubs 3.0.0, Joomla 2.5.25)
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.