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
1d2f31d5
Commit
1d2f31d5
authored
Jan 19, 2022
by
Aeolus
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
21635be2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
10 deletions
+7
-10
myapps/pc_management/api/hatch_portal.py
+5
-8
myapps/pc_management/api/production_portal.py
+2
-2
No files found.
myapps/pc_management/api/hatch_portal.py
View file @
1d2f31d5
...
...
@@ -45,17 +45,14 @@ def run_hatch_list():
"""
count_sql
=
"select count(hatch.id) as total_count"
from_sql
=
""" from hatch
where hatch.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
)
"""
if
g
.
user
.
level
==
1
:
where_sql
=
" where 0=0"
else
:
where_sql
=
""" where p.id in ( select production_type_id from admin_production_type where
admin_production_type.user_id = {} and admin_production_type.status = 1
)
)"""
.
format
(
admin
.
id
)
where_sql
=
" "
where_sql
=
""" where hatch.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
)
if
keyword
:
where_sql
+=
"""
and CONCAT(hatch.machine_no,ifnull(hatch.brand_name,''), ifnull(hatch.production_type_name,''),
...
...
myapps/pc_management/api/production_portal.py
View file @
1d2f31d5
...
...
@@ -416,7 +416,7 @@ def run_production_type_list():
where_sql
=
""" where p.id in ( select production_type_id from admin_production_type where
admin_production_type.user_id = {} and admin_production_type.status = 1
)
)
"""
.
format
(
admin
.
id
)
"""
.
format
(
admin
.
id
)
if
keyword
:
where_sql
+=
"""
and CONCAT( p.production_type_name) LIKE '
%
{keyword}
%
'
...
...
@@ -510,7 +510,7 @@ def get_production_type_detail():
where_sql
=
""" where p.id in ( select production_type_id from admin_production_type where
admin_production_type.user_id = {} and admin_production_type.status = 1
)
)
"""
.
format
(
admin
.
id
)
"""
.
format
(
admin
.
id
)
where_sql
+=
" and b.id ={}"
.
format
(
production_type_id
)
result
=
db
.
session
.
execute
(
select_sql
+
from_sql
+
where_sql
)
.
fetchall
()
...
...
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