
решил SQL запросом сформировать... собственно требуется получить на выходе login и сумму за месяц, пробовал таким запросом
Код: Выделить всё
SELECT account_id,login,SUM(discount),SUM(discount_with_tax),service_type FROM users, users_accounts,discount_transactions_all WHERE
users_accounts.account_id=discount_transactions_all.account_id
AND users.id=users_accounts.uid
AND
discount_date >= '1228071600' AND discount_date <= '1230749999' GROUP BY service_type,account_id ORDER BY account_id