Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
Automat
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
冯佳佳
Automat
Commits
039c6979
Commit
039c6979
authored
Jan 20, 2022
by
Aeolus
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
d5f61abd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
5 deletions
+9
-5
config/app_config.py
+1
-1
myapps/pc_management/api/machine_portal.py
+8
-4
No files found.
config/app_config.py
View file @
039c6979
...
@@ -24,7 +24,7 @@ class Config:
...
@@ -24,7 +24,7 @@ class Config:
JWT_SECRET
=
SECRET_KEY
JWT_SECRET
=
SECRET_KEY
TENCENT_REDIS_URL
=
os
.
getenv
(
"TENCENT_REDIS_URL"
)
TENCENT_REDIS_URL
=
os
.
getenv
(
"TENCENT_REDIS_URL"
)
MAX_CONTENT_LENGTH
=
16
*
1024
*
1024
MAX_CONTENT_LENGTH
=
16
*
1024
*
1024
SQLALCHEMY_ECHO
=
True
#
SQLALCHEMY_ECHO = True
@staticmethod
@staticmethod
def
init_app
(
app
):
def
init_app
(
app
):
...
...
myapps/pc_management/api/machine_portal.py
View file @
039c6979
...
@@ -192,11 +192,15 @@ def get_machine_detail():
...
@@ -192,11 +192,15 @@ def get_machine_detail():
from_sql
=
""" from machine
from_sql
=
""" from machine
left join place on machine.place_id = place.id
left join place on machine.place_id = place.id
left join business on machine.business_id = business.id
left join business on machine.business_id = business.id
where machine.machine_no in ( select machine_no from admin_machine where
"""
admin_machine.user_id = {user_id} and admin_machine.status = 1)
"""
.
format
(
user_id
=
admin
.
id
)
where_sql
=
" and machine.machine_no = {}"
.
format
(
machine_no
)
if
g
.
user
.
level
==
1
:
where_sql
=
" where 0=0 "
else
:
where_sql
=
""" where machine.machine_no in ( select machine_no from admin_machine where
admin_machine.user_id = {user_id} and admin_machine.status = 1) """
.
format
(
user_id
=
admin
.
id
)
where_sql
+=
" and machine.machine_no = {}"
.
format
(
machine_no
)
result
=
db
.
session
.
execute
(
select_sql
+
from_sql
+
where_sql
)
.
fetchall
()
result
=
db
.
session
.
execute
(
select_sql
+
from_sql
+
where_sql
)
.
fetchall
()
if
not
result
or
len
(
result
)
!=
1
:
if
not
result
or
len
(
result
)
!=
1
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment