|
@@ -1565,12 +1565,13 @@ module.exports = app => {
|
|
|
async getAuditStage(auditorId) {
|
|
|
const sql =
|
|
|
'SELECT sa.`aid`, sa.`times`, sa.`order`, sa.`begin_time`, sa.`end_time`, sa.`tid`, sa.`sid`,' +
|
|
|
- ' s.`order` As `sorder`, s.`status` As `sstatus`,' +
|
|
|
+ ' s.`order` As `sorder`, s.`status` As `sstatus`, s.`in_time`,' +
|
|
|
' t.`name`, t.`project_id`, t.`type`, t.`user_id` ' +
|
|
|
' FROM ?? AS sa ' +
|
|
|
' Left Join ?? AS s On sa.`sid` = s.`id` ' +
|
|
|
' Left Join ?? As t ON sa.`tid` = t.`id`' +
|
|
|
- ' WHERE ((sa.`aid` = ? and sa.`status` = ?) OR (s.`user_id` = ? and sa.`status` = ? and s.`status` = ? and sa.`times` = (s.`times`-1)))' +
|
|
|
+ ' WHERE ((sa.`aid` = ? and sa.`status` = ?) OR (s.`user_id` = ? and sa.`status` = ? and s.`status` = ? and sa.`times` = (s.`times`-1))' +
|
|
|
+ ' OR (s.`user_id` = ? and s.`status` = ? and sa.`times` = s.`times`))' +
|
|
|
' ORDER BY sa.`begin_time` DESC';
|
|
|
const sqlParam = [
|
|
|
this.tableName,
|
|
@@ -1581,6 +1582,8 @@ module.exports = app => {
|
|
|
auditorId,
|
|
|
auditConst.status.checkNo,
|
|
|
auditConst.status.checkNo,
|
|
|
+ auditorId,
|
|
|
+ auditConst.status.uncheck,
|
|
|
];
|
|
|
const result = await this.db.query(sql, sqlParam);
|
|
|
// 过滤result中存在重复sid的值, 保留最新的一条
|