uniStatPayResult.js 753 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. /**
  2. * 数据库操作
  3. */
  4. const BaseMod = require('../../base');
  5. const dbName = require("./config");
  6. class Dao extends BaseMod {
  7. constructor() {
  8. super();
  9. this.tablePrefix = false; // 不使用表前缀
  10. }
  11. // 获取符合条件的文档列表
  12. async list(data) {
  13. let {
  14. whereJson,
  15. } = data;
  16. const dbRes = await this.getCollection(dbName.uniStatPayResult).where(whereJson).get();
  17. return dbRes.data;
  18. }
  19. // 删除符合条件的文档
  20. async del(data) {
  21. let {
  22. whereJson
  23. } = data;
  24. const dbRes = await this.delete(dbName.uniStatPayResult, whereJson);
  25. return dbRes.deleted;
  26. }
  27. // 批量插入文档
  28. async adds(saveList) {
  29. return await this.batchInsert(dbName.uniStatPayResult, saveList);
  30. }
  31. }
  32. module.exports = new Dao();