spreads_model.js 596 B

12345678910111213141516171819202122232425
  1. const CheckDbBaseModel = require('../CheckDbBaseModel')
  2. class spreads_model extends CheckDbBaseModel {
  3. constructor() {
  4. super('spreads'); //表名
  5. }
  6. async findByMainId(MainId) {
  7. return await this.findOne({ MainId });
  8. }
  9. async createData(tableData) {
  10. return await this.transaction(async (connection) => {
  11. const id = await this.create(tableData);
  12. return id;
  13. });
  14. }
  15. async updateOriginData(id, profileData) {
  16. return await this.update({ id: id }, profileData);
  17. }
  18. }
  19. module.exports = new spreads_model();