Commit b01f5bd1 by Aeolus

update

parent 1cdf4683
......@@ -51,7 +51,7 @@ def run_hatch_list():
where_sql = " where 0=0"
else:
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)
admin_machine.user_id = '{user_id}' and admin_machine.status = 1)
""".format(user_id=admin.id)
if keyword:
where_sql += """
......
......@@ -51,7 +51,7 @@ def run_machine_list():
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)
admin_machine.user_id = '{user_id}' and admin_machine.status = 1)""".format(user_id=admin.id)
if keyword:
where_sql += """
and CONCAT(machine.machine_no,ifnull(machine.qrcode_no,'')) LIKE '%{keyword}%'
......@@ -198,9 +198,9 @@ def get_machine_detail():
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)
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)
where_sql += " and machine.machine_no = '{}'".format(machine_no)
result = db.session.execute(select_sql + from_sql + where_sql).fetchall()
if not result or len(result) != 1:
......
......@@ -42,7 +42,7 @@ def run_place_list():
where_sql = " where 0=0 "
else:
where_sql = """ where place.id in ( select place_id from admin_place where
admin_place.user_id = {} and admin_place.status = 1) """.format(admin.id)
admin_place.user_id = '{}' and admin_place.status = 1) """.format(admin.id)
if keyword:
where_sql += """
......
......@@ -50,7 +50,7 @@ def run_production_list():
where_sql = " where 0=0"
else:
where_sql = """ where p.id in ( select production_id from admin_production where
admin_production.user_id = {} and admin_production.status = 1
admin_production.user_id = '{}' and admin_production.status = 1
)""".format(admin.id)
if keyword:
where_sql += """
......@@ -234,9 +234,9 @@ def get_production_detail():
else:
where_sql = """ where p.id in (
select production_id from admin_production where
admin_production.user_id = {} and admin_production.status = 1
admin_production.user_id = '{}' and admin_production.status = 1
)""".format(admin.id)
where_sql += " and p.id={}".format(production_id)
where_sql += " and p.id='{}'".format(production_id)
result = db.session.execute(select_sql + from_sql + where_sql).fetchall()
if not result or len(result) != 1:
......@@ -280,7 +280,7 @@ def run_brand_list():
else:
where_sql = """ where b.id in (
select brand_id from admin_brand where
admin_brand.user_id = {} and admin_brand.status = 1
admin_brand.user_id = '{}' and admin_brand.status = 1
)""".format(admin.id)
if keyword:
where_sql += """
......@@ -377,9 +377,9 @@ def get_brand_detail():
else:
where_sql = """ where b.id in (
select brand_id from admin_brand where
admin_brand.user_id = {} and admin_brand.status = 1
admin_brand.user_id = '{}' and admin_brand.status = 1
)""".format(admin.id)
where_sql += " and b.id ={}".format(brand_id)
where_sql += " and b.id ='{}'".format(brand_id)
result = db.session.execute(select_sql + from_sql + where_sql).fetchall()
if not result or len(result) != 1:
......@@ -414,7 +414,7 @@ def run_production_type_list():
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
admin_production_type.user_id = '{}' and admin_production_type.status = 1
)
""".format(admin.id)
if keyword:
......@@ -508,10 +508,10 @@ def get_production_type_detail():
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
admin_production_type.user_id = '{}' and admin_production_type.status = 1
)
""".format(admin.id)
where_sql += " and b.id ={}".format(production_type_id)
where_sql += " and b.id ='{}'".format(production_type_id)
result = db.session.execute(select_sql + from_sql + where_sql).fetchall()
if not result or len(result) != 1:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment