|
@@ -179,11 +179,39 @@ module.exports = app => {
|
|
|
* @return {void}
|
|
|
*/
|
|
|
async getCountByStatus(tenderId, status) {
|
|
|
- if (this.ctx.tender.isTourist && status === 0) {
|
|
|
- const sql5 = 'SELECT count(*) AS count FROM ?? WHERE tid = ? ORDER BY in_time DESC';
|
|
|
- const sqlParam5 = [this.tableName, tenderId];
|
|
|
- const result5 = await this.db.query(sql5, sqlParam5);
|
|
|
- return result5[0].count;
|
|
|
+ if (this.ctx.tender.isTourist) {
|
|
|
+ let touristSql;
|
|
|
+ let touristSqlParam;
|
|
|
+ let touristResult;
|
|
|
+ switch (status) {
|
|
|
+ case 0:
|
|
|
+ touristSql = 'SELECT count(*) AS count FROM ?? WHERE tid = ? ORDER BY in_time DESC';
|
|
|
+ touristSqlParam = [this.tableName, tenderId];
|
|
|
+ touristResult = await this.db.query(touristSql, touristSqlParam);
|
|
|
+ return touristResult[0].count;
|
|
|
+ // case 1:
|
|
|
+ // touristSql = 'SELECT count(*) AS count FROM ?? WHERE tid = ? AND (status = ? OR status = ?) ORDER BY in_time DESC';
|
|
|
+ // touristSqlParam = [this.tableName, tenderId, audit.status.uncheck, audit.status.checking];
|
|
|
+ // touristResult = await this.db.query(touristSql, touristSqlParam);
|
|
|
+ // return touristResult[0].count;
|
|
|
+ // case 5:
|
|
|
+ // touristSql = 'SELECT count(*) AS count FROM ?? WHERE tid = ? AND status = ? ORDER BY in_time DESC';
|
|
|
+ // touristSqlParam = [this.tableName, tenderId, audit.status.uncheck];
|
|
|
+ // touristResult = await this.db.query(touristSql, touristSqlParam);
|
|
|
+ // return touristResult[0].count;
|
|
|
+ // case 2:
|
|
|
+ // touristSql = 'SELECT count(*) AS count FROM ?? WHERE tid = ? AND status = ? ORDER BY in_time DESC';
|
|
|
+ // touristSqlParam = [this.tableName, tenderId, audit.status.uncheck];
|
|
|
+ // touristResult = await this.db.query(touristSql, touristSqlParam);
|
|
|
+ // return touristResult[0].count;
|
|
|
+ // case 4:
|
|
|
+ // touristSql = 'SELECT count(*) AS count FROM ?? WHERE tid = ? AND status = ? ORDER BY in_time DESC';
|
|
|
+ // touristSqlParam = [this.tableName, tenderId, status];
|
|
|
+ // touristResult = await this.db.query(touristSql, touristSqlParam);
|
|
|
+ // return touristResult[0].count;
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
}
|
|
|
switch (status) {
|
|
|
case 0: // 包含你的所有变更令
|