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
11c217bb
Commit
11c217bb
authored
Jan 20, 2022
by
Aeolus
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
74b64d39
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
18 deletions
+18
-18
myapps/pc_management/api/admin_portal.py
+14
-14
myapps/pc_management/api/machine_portal.py
+1
-1
myapps/pc_management/api/place_portal.py
+1
-1
myapps/pc_management/api/rent_portal.py
+2
-2
No files found.
myapps/pc_management/api/admin_portal.py
View file @
11c217bb
...
@@ -134,7 +134,7 @@ def add_user():
...
@@ -134,7 +134,7 @@ def add_user():
account
.
comment
=
comment
account
.
comment
=
comment
account
.
created_at
=
datetime
.
datetime
.
now
()
account
.
created_at
=
datetime
.
datetime
.
now
()
account
.
updated_at
=
datetime
.
datetime
.
now
()
account
.
updated_at
=
datetime
.
datetime
.
now
()
if
password
:
if
password
is
not
None
:
account
.
password
=
password
account
.
password
=
password
db
.
session
.
add
(
account
)
db
.
session
.
add
(
account
)
db
.
session
.
commit
()
db
.
session
.
commit
()
...
@@ -196,13 +196,13 @@ def get_account_detail():
...
@@ -196,13 +196,13 @@ def get_account_detail():
@admin_route.route
(
'/edit_account'
,
methods
=
[
'GET'
,
'POST'
])
@admin_route.route
(
'/edit_account'
,
methods
=
[
'GET'
,
'POST'
])
def
edit_user
():
def
edit_user
():
json_data
=
request
.
get_json
()
json_data
=
request
.
get_json
()
old_phone
=
json_data
[
'old_phone'
]
if
'old_phone'
in
json_data
else
''
old_phone
=
json_data
[
'old_phone'
]
if
'old_phone'
in
json_data
else
None
new_phone
=
json_data
[
'new_phone'
]
if
'new_phone'
in
json_data
else
''
new_phone
=
json_data
[
'new_phone'
]
if
'new_phone'
in
json_data
else
None
user_name
=
json_data
[
'user_name'
]
if
'user_name'
in
json_data
else
'XX'
user_name
=
json_data
[
'user_name'
]
if
'user_name'
in
json_data
else
None
password
=
json_data
[
'password'
]
if
'password'
in
json_data
else
''
password
=
json_data
[
'password'
]
if
'password'
in
json_data
else
None
comment
=
json_data
[
'comment'
]
if
'comment'
in
json_data
else
''
comment
=
json_data
[
'comment'
]
if
'comment'
in
json_data
else
None
level
=
json_data
[
'level'
]
if
'level'
in
json_data
else
''
level
=
json_data
[
'level'
]
if
'level'
in
json_data
else
None
status
=
json_data
[
'status'
]
if
'status'
in
json_data
else
''
status
=
json_data
[
'status'
]
if
'status'
in
json_data
else
None
if
not
old_phone
:
if
not
old_phone
:
return
BaseResponse
(
error_code
=-
1
,
error_message
=
'old phone is null'
)
return
BaseResponse
(
error_code
=-
1
,
error_message
=
'old phone is null'
)
...
@@ -224,16 +224,16 @@ def edit_user():
...
@@ -224,16 +224,16 @@ def edit_user():
return
BaseResponse
(
**
ACCOUNT_NOT_EXISTS_ERROR
)
return
BaseResponse
(
**
ACCOUNT_NOT_EXISTS_ERROR
)
if
level
and
level
>
g
.
user
.
level
:
if
level
and
level
>
g
.
user
.
level
:
admin_info
.
level
=
level
admin_info
.
level
=
level
if
status
:
if
status
is
not
None
:
admin_info
.
status
=
status
admin_info
.
status
=
status
if
comment
:
if
comment
is
not
None
:
admin_info
.
comment
=
comment
admin_info
.
comment
=
comment
if
user_name
:
if
user_name
is
not
None
:
admin_info
.
user_name
=
user_name
admin_info
.
user_name
=
user_name
if
new_phone
:
if
new_phone
is
not
None
:
admin_info
.
phone
=
new_phone
admin_info
.
phone
=
new_phone
if
password
:
if
password
is
not
None
:
admin_info
.
password
=
password
admin_info
.
password
=
password
db
.
session
.
add
(
admin_info
)
db
.
session
.
add
(
admin_info
)
...
@@ -248,7 +248,7 @@ def edit_user():
...
@@ -248,7 +248,7 @@ def edit_user():
@admin_route.route
(
'/delete_account'
,
methods
=
[
'GET'
,
'POST'
])
@admin_route.route
(
'/delete_account'
,
methods
=
[
'GET'
,
'POST'
])
def
delete_user
():
def
delete_user
():
json_data
=
request
.
get_json
()
json_data
=
request
.
get_json
()
phone
=
json_data
[
'phone'
]
if
'phone'
in
json_data
else
''
phone
=
json_data
[
'phone'
]
if
'phone'
in
json_data
else
None
if
not
phone
:
if
not
phone
:
return
BaseResponse
(
**
PHONE_NOT_NULL_ERROR
)
return
BaseResponse
(
**
PHONE_NOT_NULL_ERROR
)
...
...
myapps/pc_management/api/machine_portal.py
View file @
11c217bb
...
@@ -52,7 +52,7 @@ def run_machine_list():
...
@@ -52,7 +52,7 @@ def run_machine_list():
else
:
else
:
where_sql
=
""" where machine.machine_no in ( select machine_no from admin_machine where
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
)
admin_machine.user_id = '{user_id}' and admin_machine.status = 1)"""
.
format
(
user_id
=
admin
.
id
)
if
keyword
:
if
keyword
is
not
None
:
where_sql
+=
"""
where_sql
+=
"""
and CONCAT(machine.machine_no,ifnull(machine.qrcode_no,'')) LIKE '
%
{keyword}
%
'
and CONCAT(machine.machine_no,ifnull(machine.qrcode_no,'')) LIKE '
%
{keyword}
%
'
...
...
myapps/pc_management/api/place_portal.py
View file @
11c217bb
...
@@ -134,7 +134,7 @@ def get_place_detail():
...
@@ -134,7 +134,7 @@ def get_place_detail():
id
=
json_data
[
"id"
]
id
=
json_data
[
"id"
]
place_model
=
Place
.
query
.
filter_by
(
id
=
id
)
.
first
()
place_model
=
Place
.
query
.
filter_by
(
id
=
id
)
.
first
()
if
place_model
:
if
place_model
is
not
None
:
return
BaseResponse
(
data
=
{
"place_name"
:
place_model
.
place_name
,
return
BaseResponse
(
data
=
{
"place_name"
:
place_model
.
place_name
,
"address"
:
place_model
.
address
,
"address"
:
place_model
.
address
,
"parent_id"
:
place_model
.
parent_id
,
"parent_id"
:
place_model
.
parent_id
,
...
...
myapps/pc_management/api/rent_portal.py
View file @
11c217bb
...
@@ -66,7 +66,7 @@ def run_rent_list():
...
@@ -66,7 +66,7 @@ def run_rent_list():
"""
"""
where_sql
=
" WHERE 0=0 "
where_sql
=
" WHERE 0=0 "
if
keyword
:
if
keyword
is
not
None
:
where_sql
+=
"""
where_sql
+=
"""
and CONCAT(rent.rent_no,
and CONCAT(rent.rent_no,
wx_user.phone) LIKE '
%
{keyword}
%
'
wx_user.phone) LIKE '
%
{keyword}
%
'
...
@@ -154,7 +154,7 @@ def get_rent_detail():
...
@@ -154,7 +154,7 @@ def get_rent_detail():
"""
"""
where_sql
=
" where rent.rent_no = '{}'"
.
format
(
rent_no
)
where_sql
=
" where rent.rent_no = '{}'"
.
format
(
rent_no
)
if
rent_detail_id
:
if
rent_detail_id
is
not
None
:
where_sql
+=
" and rent_detail.id = '{}'"
.
format
(
rent_detail_id
)
where_sql
+=
" and rent_detail.id = '{}'"
.
format
(
rent_detail_id
)
if
g
.
user
.
level
!=
1
:
if
g
.
user
.
level
!=
1
:
where_sql
+=
""" and rent.business_id in (
where_sql
+=
""" and rent.business_id in (
...
...
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