rpt_template_facade.js 531 B

1234567891011121314151617181920
  1. /**
  2. * Created by Tony on 2017/8/9.
  3. */
  4. import mongoose from "mongoose";
  5. let rpt_tpl_mdl = mongoose.model("rpt_templates");
  6. let rpt_tpl_ext_code_mdl = mongoose.model("rpt_ext_code_tpl");
  7. module.exports = {
  8. getRptTemplate: getRptTemplate,
  9. getExtCodeTpl: getExtCodeTpl
  10. };
  11. async function getRptTemplate(tplId) {
  12. //console.log('templateId: ' + parseInt(tplId));
  13. return await rpt_tpl_mdl.findOne({"ID": parseInt(tplId)}, '-_id');
  14. }
  15. async function getExtCodeTpl() {
  16. return await rpt_tpl_ext_code_mdl.find({});
  17. }