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

class works_model extends CheckDbBaseModel {
    constructor() {
        super('works'); //表名
    }

    async findBycp_work_id(cp_work_id) {
        return await this.findOne({ cp_work_id });
    }

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

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

module.exports = new works_model();