xjconline 2 nedēļas atpakaļ
vecāks
revīzija
6d7d904910
2 mainītis faili ar 7 papildinājumiem un 1 dzēšanām
  1. 1 0
      src/common/core_views.py
  2. 6 1
      src/weixin/controls.py

+ 1 - 0
src/common/core_views.py

@@ -203,6 +203,7 @@ def admin_handler(handler, request, is_vauth, *args, **kwargs):
 
 def to_suc(data={},code=0):
     info = {}
+    info["errno"] = code
     info["data"] = data
     info["code"] = code
     info = eval(str(info).replace("None",'""'))

+ 6 - 1
src/weixin/controls.py

@@ -1953,6 +1953,9 @@ def get_stock_players(**kwargs):
                 today_record["total_income"] = "{}%".format(today_record["total_income"]*100)
                 #today_record["cur_stock_fund"] = 0.0
                 for item in today_record["today_stock"]:
+                    if 'stock_id' not in item:
+                        today_record["cur_stock_fund"] = 0.0
+                        continue
                     if int(item["stock_id"]) == int(stock_id):
                         today_record["cur_stock_fund"] = float(item["fund"]) if item["fund"] else 0.0
                     else:
@@ -2071,8 +2074,10 @@ def get_mine_latest(request):
     """
     try:
         user_id = request.user.get("id")
-
+        cur_match_id = ccc.get_cur_match().id
         match_id = ccc.cache.hget("PLAYER_LATEST_%d" % user_id,"match_id")
+        if cur_match_id != int(match_id):
+            return {"player_id":user_id,"match_id":match_id,"user_id":user_id}
         match_group = ccc.cache.hget("PLAYER_LATEST_%d" % user_id,"match_group")
         _today = ccc.cache.hget("PLAYER_LATEST_%d" % user_id,"stock_date")
         if _today: