|
@@ -389,9 +389,9 @@ module.exports = app => {
|
|
|
const sql = 'SELECT ma.`aid`, ma.`times`, ma.`order`, ma.`begin_time`, ma.`end_time`, ma.`tid`, ma.`caid`,' +
|
|
|
' m.`status` As `mstatus`, m.`code` As `mcode`,' +
|
|
|
' t.`name`, t.`project_id`, t.`type`, t.`user_id` ' +
|
|
|
- ' FROM ?? AS ma, ?? AS m, ?? As t ' +
|
|
|
+ ' FROM ?? AS ma LEFT JOIN ?? AS m ON ma.`caid` = m.`id` LEFT JSON ?? As t ON ma.`tid` = t.`id`' +
|
|
|
' WHERE ((ma.`aid` = ? and ma.`status` = ?) OR (m.`uid` = ? and ma.`status` = ? and m.`status` = ? and ma.`times` = (m.`times`-1)))' +
|
|
|
- ' and ma.`caid` = m.`id` and ma.`tid` = t.`id` ORDER BY ma.`begin_time` DESC';
|
|
|
+ ' ORDER BY ma.`begin_time` DESC';
|
|
|
const sqlParam = [this.tableName, this.ctx.service.changeApply.tableName, this.ctx.service.tender.tableName, auditorId, auditConst.status.checking, auditorId, auditConst.status.checkNo, auditConst.status.checkNo];
|
|
|
const result = await this.db.query(sql, sqlParam);
|
|
|
// 过滤result中存在重复sid的值, 保留最新的一条
|