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

class checks_products_model extends CheckDbBaseModel {
    constructor() {
        super('products'); //表名
    }

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

    async createOriginData(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 checks_products_model();