u4819210 / social-networks-for-fun

Automatically exported from code.google.com/p/social-networks-for-fun
0 stars 0 forks source link

Check-In Implementation #6

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Check-In is basic function on almost all LBS apps. What they normally have is 
showing "xxx has yyy check-ins". Our check-in is not just that, but also 
associating with our game and rewards. Our check-in has following rules:

1. Each user has a total check-ins, s/he also has sub check-ins for individual 
business, each Check-In click gets 1 check-in. Frontend will display: "xxx has 
yyy total check-ins", "xxx has zzz check-ins for business qqq". The sum of sub 
check-ins equal to total check-ins.
2. After user clicks Check-In button, s/he not only gets check-in numbers, but 
also Points. Points determine Ranks later.
3. Points also has sub numbers for individual businesses, and a total number to 
sum up all of sub numbers. Frontend will display: "xxx has yyy total points", 
"xxx has zzz points for business qqq". The sub points determine Ranks for each 
army in each city, details refer to "City War" game. 
4. If user checks-in within 1 mile of the individual business, it's treated as 
"On Site" check-in, it will get 1 check-in and higher points. Different 
business gets different level of points, the businesses that have contracts 
with us will get higher points. Initially when no contract is signed, all 
businesses have a flat number of points, like 8 points. 
5. If user checks-in beyond 1 mile of the individual business, it's treated as 
"Off Site" check-in, it will get lower points. The number of "Off Site" 
check-ins will be limited per day, such as 4 times a day. Each "Off Site" 
check-in gets 0 check-in and lower points, choose 1 point for now.
6. Points can be increased, but also decreased, per City War game rule.

On Backend API:

1. Create a Check-In table, called elgg_checkin: userid, business_id, check-in, 
point.
2. Write API based on above rules. 

Original issue reported on code.google.com by jt.xion...@gmail.com on 9 Aug 2010 at 6:09

GoogleCodeExporter commented 8 years ago
tables for record the check in stuffs

check_in_history:
check_in_no,checheck_in_user_name,check_in_time,check_in_longtitude,check_in_lat
itude,check_in_target_id,check_in_type,check_in_points

check_in_maintain
check_in_type, check_in_base_points, check_in_business_id 

check_in_limit
check_in_times_per_user_per_day, check_in_type

please review

Changed 9 days ago by jt_xiong ¶
  1.check_in_type : off-site check in / on-site check in

2.check_in_maintain table: maintain check in config data e.g. define what's the 
check in point for some specified business

3.what's difference between check_in_target and check_in_business_id?

basically they are the same thing in different tables

4.what's check_in_base_points? 

The base_point is a base points the user can get from a onsite check in, maybe 
later you will add some points calculate algorithm , but the base points is 
what user will get at least when they check in.

Original comment by jt.xion...@gmail.com on 13 Aug 2010 at 10:11

GoogleCodeExporter commented 8 years ago

Original comment by zhangyon...@gmail.com on 10 Sep 2010 at 9:10