|
@@ -568,7 +568,7 @@ def download_records(request):
|
|
|
"""
|
|
"""
|
|
|
"""
|
|
"""
|
|
|
kwargs = request.json
|
|
kwargs = request.json
|
|
|
- header = [u"排名",u"选手",u"初始资产(万)",u"昨日资产(万)",u"今日资产",u"今日盈亏",u"总盈亏",u"昨日持股",u"今日持股"]
|
|
|
|
|
|
|
+ header = [u"排名",u"选手",u"分组",u"初始资产(万)",u"昨日资产(万)",u"今日资产",u"今日盈亏",u"总盈亏",u"昨日持股",u"今日持股",u"图片"]
|
|
|
|
|
|
|
|
match_id = kwargs.get("match_id")
|
|
match_id = kwargs.get("match_id")
|
|
|
qset = cm.PlayerRecord.get_db_model(match_id).objects.all()
|
|
qset = cm.PlayerRecord.get_db_model(match_id).objects.all()
|
|
@@ -595,6 +595,12 @@ def download_records(request):
|
|
|
item["usercode"] = user.usercode
|
|
item["usercode"] = user.usercode
|
|
|
item["today_income"] = "{}%".format(item["today_income"]*100)
|
|
item["today_income"] = "{}%".format(item["today_income"]*100)
|
|
|
item["total_income"] = "{}%".format(item["total_income"]*100)
|
|
item["total_income"] = "{}%".format(item["total_income"]*100)
|
|
|
|
|
+ try:
|
|
|
|
|
+ match_group_name = cm.MatchGroup.objects.filter(id=item["match_group"]).first().name
|
|
|
|
|
+ except:
|
|
|
|
|
+ match_group_name = ""
|
|
|
|
|
+ item["match_group_name"] = match_group_name
|
|
|
|
|
+ item["today_stock_imgs"] = json.loads(item["today_stock_img"]) if item["today_stock_img"] else []
|
|
|
|
|
|
|
|
today_stock = json.loads(item["today_stock"]) if item["today_stock"] else []
|
|
today_stock = json.loads(item["today_stock"]) if item["today_stock"] else []
|
|
|
today_stock = list(filter(lambda x:x["name"],today_stock if today_stock else []))
|
|
today_stock = list(filter(lambda x:x["name"],today_stock if today_stock else []))
|
|
@@ -627,13 +633,15 @@ def download_records(request):
|
|
|
[
|
|
[
|
|
|
item["group_rank"],
|
|
item["group_rank"],
|
|
|
item["username"],
|
|
item["username"],
|
|
|
|
|
+ item["match_group_name"],
|
|
|
item["init_fund"],
|
|
item["init_fund"],
|
|
|
item["yesterday_fund"],
|
|
item["yesterday_fund"],
|
|
|
item["today_fund"],
|
|
item["today_fund"],
|
|
|
item["today_income"],
|
|
item["today_income"],
|
|
|
item["total_income"],
|
|
item["total_income"],
|
|
|
yesterday_stock,
|
|
yesterday_stock,
|
|
|
- today_stock
|
|
|
|
|
|
|
+ today_stock,
|
|
|
|
|
+ item["today_stock_imgs"]
|
|
|
])
|
|
])
|
|
|
except Exception as e:
|
|
except Exception as e:
|
|
|
print(e)
|
|
print(e)
|
|
@@ -1171,3 +1179,16 @@ def caculate_inout(**kwargs):
|
|
|
"init_fund":init_fund}
|
|
"init_fund":init_fund}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+def baike_detail_top(**kwargs):
|
|
|
|
|
+ """
|
|
|
|
|
+ """
|
|
|
|
|
+ _id = kwargs.get("id")
|
|
|
|
|
+ action = kwargs.get("action")
|
|
|
|
|
+
|
|
|
|
|
+ if action == "top":
|
|
|
|
|
+ cm.BaikeDetail.objects.filter(id=_id).update(istop=1)
|
|
|
|
|
+ else:
|
|
|
|
|
+ cm.BaikeDetail.objects.filter(id=_id).update(istop=0)
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|