|
@@ -218,16 +218,16 @@ module.exports = app => {
|
|
|
* @return {Promise<void>}
|
|
|
*/
|
|
|
async getAuditChange(uid) {
|
|
|
- const sql = 'SELECT ca.`uid`, ca.`times`, ca.`usite`, ca.`usort`, ca.`tid`, ca.`cid`, ca.`sin_time`, ca.`name` As `caname`, ' +
|
|
|
- ' c.`code` As `ccode`, c.`name` As `cname`, c.`status` As `cstatus`, ' +
|
|
|
+ const sql = 'SELECT ca.`uid`, ca.`times`, ca.`usite`, ca.`usort`, ca.`tid`, ca.`cid`, ca.`begin_time`, ca.`end_time`, ca.`sin_time`, ca.`name` As `caname`, ' +
|
|
|
+ ' c.`code` As `ccode`, c.`name` As `cname`, c.`status` As `cstatus`, c.`cin_time`, ' +
|
|
|
' t.`name`, t.`type`, t.`user_id` ' +
|
|
|
' FROM ?? AS ca, ?? AS c, ?? As t ' +
|
|
|
' WHERE ca.`uid` = ? and ca.`status` = ? and c.`status` != ?' +
|
|
|
' and ca.`cid` = c.`cid` and ca.`tid` = t.`id` ORDER BY ca.`sin_time` DESC';
|
|
|
- const sqlParam = [this.tableName, this.ctx.service.change.tableName, this.ctx.service.tender.tableName, uid, 2, auditConst.status.uncheck];
|
|
|
+ const sqlParam = [this.tableName, this.ctx.service.change.tableName, this.ctx.service.tender.tableName, uid, auditConst.status.checking, auditConst.status.uncheck];
|
|
|
const changes = await this.db.query(sql, sqlParam);
|
|
|
for (const c of changes) {
|
|
|
- if (c.cstatus === auditConst.status.checkNo) {
|
|
|
+ if (c.cstatus === auditConst.status.checkNo || c.cstatus === auditConst.status.revise) {
|
|
|
const preSql = 'SELECT pa.`id`, pa.`account`, pa.`account_group`, pa.`name`, pa.`company`, pa.`role`, pa.`telephone` FROM ?? As ca, ?? As pa ' +
|
|
|
' WHERE ca.cid = ? and ca.times = ? and ca.status = ? and ca.uid = pa.id';
|
|
|
const preSqlParam = [this.tableName, this.ctx.service.projectAccount.tableName, c.cid, c.times - 1, c.cstatus];
|