1234567891011121314151617181920212223242526272829303132333435363738394041 |
- 'use strict';
- /**
- * 标段数据模型
- *
- * @author CaiAoLin
- * @date 2021/8/23
- * @version
- */
- module.exports = app => {
- class TenderMap extends app.BaseService {
- /**
- * 构造函数
- *
- * @param {Object} ctx - egg全局变量
- * @return {void}
- */
- constructor(ctx) {
- super(ctx);
- this.tableName = 'tender_map';
- }
- async addMap(tid, name) {
- const data = {
- tid,
- name,
- create_time: new Date(),
- };
- return await this.db.insert(this.tableName, data);
- }
- async saveMap(id, updateData) {
- return await this.db.update(this.tableName, updateData, { where: { id } });
- }
- }
- return TenderMap;
- };
|