|
@@ -1953,6 +1953,9 @@ def get_stock_players(**kwargs):
|
|
today_record["total_income"] = "{}%".format(today_record["total_income"]*100)
|
|
today_record["total_income"] = "{}%".format(today_record["total_income"]*100)
|
|
#today_record["cur_stock_fund"] = 0.0
|
|
#today_record["cur_stock_fund"] = 0.0
|
|
for item in today_record["today_stock"]:
|
|
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):
|
|
if int(item["stock_id"]) == int(stock_id):
|
|
today_record["cur_stock_fund"] = float(item["fund"]) if item["fund"] else 0.0
|
|
today_record["cur_stock_fund"] = float(item["fund"]) if item["fund"] else 0.0
|
|
else:
|
|
else:
|
|
@@ -2071,8 +2074,10 @@ def get_mine_latest(request):
|
|
"""
|
|
"""
|
|
try:
|
|
try:
|
|
user_id = request.user.get("id")
|
|
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")
|
|
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")
|
|
match_group = ccc.cache.hget("PLAYER_LATEST_%d" % user_id,"match_group")
|
|
_today = ccc.cache.hget("PLAYER_LATEST_%d" % user_id,"stock_date")
|
|
_today = ccc.cache.hget("PLAYER_LATEST_%d" % user_id,"stock_date")
|
|
if _today:
|
|
if _today:
|