Browse Source

更新 'main.py'

nemo0526 3 years ago
parent
commit
7c606d645f
1 changed files with 5 additions and 1 deletions
  1. 5 1
      main.py

+ 5 - 1
main.py

@@ -251,12 +251,16 @@ async def optim(request: Request, Authorize: AuthJWT = Depends()):
     for temp3 in db.query(statement3):
         print(temp3['value'])
         z=temp3['value']
+    statement4 = 'SELECT  value FROM record_tower WHERE record_tower.key = "count"'
+    for tower in db.query(statement4):
+        print(tower['value'])
+        count=tower['value']
     try:
         Authorize.jwt_required()
     except Exception as e:
         print(e)
         return RedirectResponse('/login')
-    return templates.TemplateResponse(name='optim.html',context={'request': request,"x":x,"y":y,"z":z})
+    return templates.TemplateResponse(name='optim.html',context={'request': request,"x":x,"y":y,"z":z,"count":count})
 
 
 @app.get('/vibration', response_class=HTMLResponse)