Explorar o código

userstock 去重

xjc hai 5 meses
pai
achega
62829a9b30
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  1. 4 0
      src/weixin/controls.py

+ 4 - 0
src/weixin/controls.py

@@ -795,6 +795,10 @@ def add_model(cls,**kwargs):
                             name = ts["name"] 
                         )
                         stock_id = stock.id
+                        try:
+                            cm.UserStock.objects.filter(stock_id=stock_id,player_id=player.id,stock_date=stock_date).delete()
+                        except Exception as e:
+                            print(e)
                         usobj,flag = cm.UserStock.objects.get_or_create(
                             stock_id = stock_id,
                             player_id = player.id,