1234567891011121314151617181920212223242526272829303132333435363738 |
- 'use strict';
- /**
- * Created by Tony on 2019/5/28.
- */
- const BaseService = require('../base/base_service');
- module.exports = app => {
- class RptPreDefineCfg extends BaseService {
- /**
- * 构造函数
- *
- * @param {Object} ctx - egg全局变量
- * @return {void}
- */
- constructor(ctx) {
- super(ctx);
- this.tableName = 'rpt_cfg';
- this.dataId = 'userId';
- }
- async getCfgById(id) {
- this.initSqlBuilder();
- this.sqlBuilder.setAndWhere('userId', {
- value: '"' + id + '"',
- operate: '=',
- });
- this.sqlBuilder.columns = ['userId', 'defined_content'];
- const [sql, sqlParam] = this.sqlBuilder.build(this.tableName);
- const list = await this.db.query(sql, sqlParam);
- return list;
- }
- }
- return RptPreDefineCfg;
- };
|