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
3d3d292f
Commit
3d3d292f
authored
Feb 23, 2022
by
Aeolus
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
d76703a9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
5 deletions
+4
-5
myapps/pc_management/api/business_portal.py
+1
-1
service/admin_service.py
+3
-4
No files found.
myapps/pc_management/api/business_portal.py
View file @
3d3d292f
...
...
@@ -289,6 +289,6 @@ def run_edit_admin_account():
admin_business
.
rate
=
rate
admin_business
.
status
=
1
db
.
session
.
add
(
admin_business
)
db
.
session
.
commit
()
db
.
session
.
commit
()
return
BaseResponse
()
service/admin_service.py
View file @
3d3d292f
...
...
@@ -65,7 +65,7 @@ class AdminService(object):
admin_account.comment,admin_account.parent_id, admin_account.created_at,
admin_account.updated_at,admin_account.id, admin_account.user_no
"""
count_sql
=
"select count(
admin_account.id
) as total_count"
count_sql
=
"select count(
1
) as total_count"
from_sql
=
" from admin_account "
if
g
.
user
.
level
==
1
:
...
...
@@ -75,10 +75,10 @@ class AdminService(object):
where
admin_account.id in (
select user_id from admin_business where business_id in (
select business_id from admin_business where user_id =
{user_id} and status = 1
select business_id from admin_business where user_id =
'{user_id}' and status = '1'
)
)
and admin_account.level >=
{level}
and admin_account.level >=
'{level}'
"""
.
format
(
user_id
=
g
.
user
.
id
,
level
=
g
.
user
.
level
)
if
user_id
:
...
...
@@ -104,7 +104,6 @@ class AdminService(object):
return
{
"list"
:
[],
"page"
:
page
,
"pageSize"
:
page_size
,
"total_count"
:
0
}
else
:
total_count
=
count_result
.
total_count
result
=
db
.
session
.
execute
(
select_sql
+
from_sql
+
where_sql
+
order_sql
+
limit_sql
)
.
fetchall
()
return_data
=
[]
...
...
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