修改条目数限制

duizhaopin
apan_youxiang@163.com 2 years ago
parent fc05489bbb
commit cd74dbf45c

@ -54,14 +54,19 @@ def add_update_drug_form():
setattr(obj, 'is_del', 0)
bll_obj.update(obj)
else:
obj = EntityMedicamentExtend()
for i in finds:
setattr(obj, i, request.values.get(i))
sort_index = bll_obj.execute(
"select max(sort_index) sort_index from rms_medicament_extend").fetchone()
setattr(obj, "sort_index", int(sort_index.sort_index or '0') + 1)
bll_obj.insert(obj)
return jsonify(Utils.true_return())
count_num = bll_obj.execute(
"select count(id) count_num from rms_medicament_extend").fetchone()
if count_num.count_num < 30:
obj = EntityMedicamentExtend()
for i in finds:
setattr(obj, i, request.values.get(i))
sort_index = bll_obj.execute(
"select max(sort_index) sort_index from rms_medicament_extend").fetchone()
setattr(obj, "sort_index", int(sort_index.sort_index or '0') + 1)
bll_obj.insert(obj)
return jsonify(Utils.true_return())
else:
return jsonify(Utils.false_return())
@drug_form_router.route("/del", methods=["GET", "POST"])
@token_auth.login_required

Loading…
Cancel
Save