xjconline 2 years ago
parent
commit
a9b194d00f
2 changed files with 11 additions and 11 deletions
  1. 10 10
      src/weixin/controls.py
  2. 1 1
      templates/index.html

+ 10 - 10
src/weixin/controls.py

@@ -341,15 +341,15 @@ def format_today_record(today_record):
             today_record["cangwei"] = "{}%".format(round(today_stock_total/today_record["today_fund"],4)*100)
             today_record["today_stock_total"] = today_stock_total
 
-            #win_rate = ccc.cache.hget("PLAYER_LATEST_%d" % today_record["user_id"],"win_rate")
-            #if win_rate:
-            #    today_record["win_rate"] = str(float(win_rate)*100)+"%"
-            #else:
-            #    today_record["win_rate"] = "0.0%"
+            win_rate = ccc.cache.hget("PLAYER_LATEST_%d" % today_record["user_id"],"win_rate")
+            if win_rate:
+                today_record["win_rate"] = str(float(win_rate)*100)+"%"
+            else:
+                today_record["win_rate"] = "0.0%"
 
-            #
-            win_rate = calc_win_rate(today_record["user_id"],today_record["match_id"])
-            today_record["win_rate"] = win_rate
+            ##
+            #win_rate = calc_win_rate(today_record["user_id"],today_record["match_id"])
+            #today_record["win_rate"] = win_rate
 
 
 
@@ -401,12 +401,12 @@ def get_match_group_users(match_id,match_group):
     users = list(cm.Player.objects.filter(match_id=match_id,match_group=match_group).values())
     return users
 
-@ccc.cache_data()
+#@ccc.cache_data()
 def get_match_groups(match_id):
     """
     """
     match = cm.Match.objects.filter(id=match_id).values().first()
-    groups = list(cm.MatchGroup.objects.filter(match_id=match_id,is_active=1).order_by("order").values())
+    groups = list(cm.MatchGroup.objects.filter(match_id=match_id,is_active=1).order_by("-order").values())
     return match,groups
 
 def get_cache_rank_list(match_id,today):

File diff suppressed because it is too large
+ 1 - 1
templates/index.html