'use strict'; module.exports = app => { class Schedule extends app.BaseService { constructor(ctx) { super(ctx); this.tableName = 'schedule'; } async saveMode(data) { const transaction = await this.db.beginTransaction(); try { const options = { where: { tid: this.ctx.tender.id, }, }; const updateData = { mode: data, }; await transaction.update(this.tableName, updateData, options); await transaction.commit(); return true; } catch (err) { await transaction.rollback(); throw err; } } } return Schedule; };