修改条目数限制

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

Loading…
Cancel
Save