Created
September 17, 2019 11:03
-
-
Save ohaddahan/8badd434c72376c36307432ca32a2848 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@accounts_users = Account.find_by(id: account_id).accounts_users ; nil | |
# Total New Volunteer's Visa - all new users from "AccountUser" table : | |
@total_new_users = @accounts_users.where('created_at > ?', from).where('created_at < ?', to) | |
# Toal New Volunteer Registered - sign-in > 0 from previous new volunteer visa | |
@toal_new_volunteer_registered = @accounts_users.joins(:user).where('sign_in_count > 0') | |
@total_new_volunteers_visa = @accounts_users.where('visa_start > ?', from) | |
# Total Visa Ended - all visa_expiry from account_users table | |
@total_visa_ended = @accounts_users.where('visa_end > ?', from).where('visa_end < ?', to) | |
# The "Table" of follow-up needed come from "activities_follow_ups" table, and it will present all feedback analyzed for the month before the last month for"overdue" feedbacks only. | |
@new_follow_ups = @accounts_users.activity_follow_ups. | |
where('created_at > ?', 1.days.ago.beginning_of_day). | |
where('created_at < ?', Time.now.beginning_of_day). | |
where(status_int: ActivityFollowUp.get_status_int "new"). | |
group(:accounts_user_id). | |
count | |
@overdue_follow_ups = @accounts_users.activity_follow_ups. | |
where(status_int: ActivityFollowUp.get_status_int "overdue"). | |
group(:accounts_user_id). | |
count |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment