Comments (3)
So I first added a few entries to the member_point_transaction table as a quick test, and then I changed the member view code to left join with the member_point_transaction table based on contact_id. In order to use aggregate functions, I added the group by line so that the points will group based on the contact_id. Finally I just added the points field to the view and set it to the sum of each contact's points found in the member_point_transaction table. I used the coalesce() function so that instead of anyone's points being [NULL], it will just return as 0 instead.
Example member_point_transaction rows:
from astro-api.
Link to new Member View SQL:
https://drive.google.com/file/d/1pf4djsVKuXFXJ3GtSSFIMTPffQjwoNh_/view?usp=sharing
Link to new Active Member View SQL:
https://drive.google.com/file/d/1uBYXd0tHgW87hyyV5rhb60kcTUJ-FAAr/view?usp=sharing
from astro-api.
Changes to the SQL code have been uploaded to our Google Drive. Great work Ben!
from astro-api.
Related Issues (19)
- Get membership status endpoint
- SQL Service update
- SQL Service insert
- SQL Service delete
- Generate member ledger file endpoint
- Omni-search for events table
- Omni-search for contact table
- Permissions System Design HOT 1
- isMember Update
- Create Contact-Member View
- GET Contact-Member View
- GET Contact-Member View Fields
- POST Membership
- PUT Membership
- Create Event & Attendance
- Grant member points
- Create Contact
- Refactor naming scheme
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from astro-api.