
const CheckDbBaseModel = require('../CheckDbBaseModel')

class spreads_model extends CheckDbBaseModel {
    constructor() {
        super('spreads'); //表名
    }

    async findByMainId(MainId) {
        return await this.findOne({ MainId });
    }

    async createData(tableData) {
        return await this.transaction(async (connection) => {
            const id = await this.create(tableData);
            return id;
        });
    }

    async updateOriginData(id, profileData) {
        return await this.update({ id: id }, profileData);
    }
}

module.exports = new spreads_model();