|
@@ -154,10 +154,19 @@ def add_model(cls,**kwargs):
|
|
yesterday_stock_img = yesterday.today_stock_img
|
|
yesterday_stock_img = yesterday.today_stock_img
|
|
yesterday_is_markt = yesterday.is_markt
|
|
yesterday_is_markt = yesterday.is_markt
|
|
else:
|
|
else:
|
|
- yesterday_fund = init_fund
|
|
|
|
|
|
+ yesterday_fund = today_fund
|
|
yesterday_stock = ""
|
|
yesterday_stock = ""
|
|
yesterday_stock_img = ""
|
|
yesterday_stock_img = ""
|
|
yesterday_is_markt = 0
|
|
yesterday_is_markt = 0
|
|
|
|
+ if kwargs.get("id"):
|
|
|
|
+ if cm.PlayerRecord.get_db_model(match_id).objects.filter(match_id=match_id,user_id=user_id).count()==1:
|
|
|
|
+ init_fund = today_fund
|
|
|
|
+ cm.Player.objects.filter(user_id=user_id,match_id=match_id).update(fund=today_fund)
|
|
|
|
+ else:
|
|
|
|
+ if not cm.PlayerRecord.get_db_model(match_id).objects.filter(match_id=match_id,user_id=user_id).exists():
|
|
|
|
+ init_fund = today_fund
|
|
|
|
+ cm.Player.objects.filter(user_id=user_id,match_id=match_id).update(fund=today_fund)
|
|
|
|
+
|
|
obj,flag = cm.PlayerRecord.get_db_model(match_id).objects.get_or_create(
|
|
obj,flag = cm.PlayerRecord.get_db_model(match_id).objects.get_or_create(
|
|
player_id=player_id,
|
|
player_id=player_id,
|
|
match_id=match_id,
|
|
match_id=match_id,
|