Skip to content

Commit

Permalink
Closes #87
Browse files Browse the repository at this point in the history
  • Loading branch information
fspc committed Apr 17, 2019
1 parent 70c8a37 commit fa72881
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions json/transaction.php
Expand Up @@ -708,12 +708,12 @@ function membership_benefits($contact_id, $membership_discount) {

$query = "SELECT contacts.contact_id, CONCAT(last_name, ', ', first_name, ' ',middle_initial) AS full_name,
CONCAT(first_name, ' ', last_name) AS normal_full_name, contacts.email AS email, contacts.phone AS phone,
transaction_log.date AS membership_start, SUBSTRING_INDEX(DATE_ADD(date, INTERVAL 365 DAY), ' ', 1) AS expiration_date
MAX(transaction_log.date) AS membership_start, MAX(SUBSTRING_INDEX(DATE_ADD(date, INTERVAL 365 DAY), ' ', 1)) AS expiration_date
FROM transaction_log LEFT JOIN contacts ON transaction_log.sold_to = contacts.contact_id
WHERE SUBSTRING_INDEX(date, ' ', 1) <= DATE_ADD(date, INTERVAL 365 DAY)
AND (transaction_type='Memberships' AND paid=1) AND " .
$contact_id .
" ORDER by membership_start DESC;";
" GROUP BY contact_id ORDER by membership_start DESC;";

$sql = mysql_query($query, $YBDB) or die(mysql_error());

Expand Down

0 comments on commit fa72881

Please sign in to comment.