Commit a18d598f by Aeolus

update

parent aa14c113
...@@ -36,8 +36,9 @@ def run_hatch_list(): ...@@ -36,8 +36,9 @@ def run_hatch_list():
keyword = json_data.get("keyword", None) keyword = json_data.get("keyword", None)
admin = g.user admin = g.user
select_sql = """select hatch.machine_no, hatch.hatch_no,hatch.production_id,hatch.production_name,hatch.title,hatch.left_count, select_sql = """select hatch.id,hatch.machine_no, hatch.hatch_no,hatch.production_id,hatch.production_name,
hatch.total_count,hatch.brand_id,hatch.brand_name,hatch.production_type_id,hatch.production_type_name, hatch.title,hatch.left_count,hatch.total_count,hatch.brand_id,hatch.brand_name,
hatch.production_type_id,hatch.production_type_name,
hatch.price,hatch.original_price, hatch.weight,hatch.weight_unit,hatch.weight_error, hatch.price,hatch.original_price, hatch.weight,hatch.weight_unit,hatch.weight_error,
hatch.expiration_date,hatch.expiration_date_unit,hatch.is_expiration_date, hatch.expiration_date,hatch.expiration_date_unit,hatch.is_expiration_date,
hatch.img, hatch.tags, hatch.content,hatch.summary,hatch.status hatch.img, hatch.tags, hatch.content,hatch.summary,hatch.status
...@@ -73,6 +74,7 @@ def run_hatch_list(): ...@@ -73,6 +74,7 @@ def run_hatch_list():
{"production_name": info.production_name, "production_id": info.production_id, {"production_name": info.production_name, "production_id": info.production_id,
"machine_no": info.machine_no, "machine_no": info.machine_no,
"hatch_no": info.hatch_no, "hatch_no": info.hatch_no,
"hatch_id": info.id,
"left_count": info.left_count, "left_count": info.left_count,
"total_count": info.total_count, "total_count": info.total_count,
"title": info.title, "brand_id": info.brand_id, "brand_name": info.brand_name, "title": info.title, "brand_id": info.brand_id, "brand_name": info.brand_name,
...@@ -118,9 +120,9 @@ def run_add_machine(): ...@@ -118,9 +120,9 @@ def run_add_machine():
production_name = json_data["production_name"] production_name = json_data["production_name"]
title = json_data.get("title", "") title = json_data.get("title", "")
brand_id = json_data.get("brand_id", 0) brand_id = json_data.get("brand_id", 0)
brand_name = json_data.get("brand_name", 0) brand_name = json_data.get("brand_name", "")
production_type_id = json_data.get("production_type_id", 0) production_type_id = json_data.get("production_type_id", 0)
production_type_name = json_data.get("production_type_name", 0) production_type_name = json_data.get("production_type_name", "")
price = json_data.get("price", 0) price = json_data.get("price", 0)
original_price = json_data.get("original_price", 0) original_price = json_data.get("original_price", 0)
weight = json_data.get("weight", 0) weight = json_data.get("weight", 0)
...@@ -134,7 +136,7 @@ def run_add_machine(): ...@@ -134,7 +136,7 @@ def run_add_machine():
content = json_data.get("content", None) content = json_data.get("content", None)
summary = json_data.get("summary", None) summary = json_data.get("summary", None)
left_count = json_data.get("left_count", 0) left_count = json_data.get("left_count", 0)
total_count = json_data.get["total_count"] total_count = json_data["total_count"]
hatch_model = Hatch() hatch_model = Hatch()
hatch_model.machine_no = machine_no hatch_model.machine_no = machine_no
......
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