rpt_template_facade.js 552 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. module.exports = {
  7. getRptTemplate: getRptTemplate,
  8. getRptTemplates: getRptTemplates
  9. };
  10. async function getRptTemplate(tplId) {
  11. //console.log('templateId: ' + parseInt(tplId));
  12. return await rpt_tpl_mdl.findOne({"ID": parseInt(tplId)}, '-_id');
  13. }
  14. async function getRptTemplates(tplIds) {
  15. //console.log('templateId: ' + parseInt(tplId));
  16. return await rpt_tpl_mdl.find({"ID": {"$in": tplIds}}, '-_id');
  17. }