|
@@ -218,12 +218,19 @@ 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.`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 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 ' +
|
|
|
+ ' FROM ?? AS ca LEFT JOIN ?? AS c ON ca.`cid` = c.`cid` ' +
|
|
|
+ ' LEFT JOIN ?? As t ON ca.`tid` = t.`id` ' +
|
|
|
' 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';
|
|
|
+ ' ORDER BY ca.`sin_time` DESC';
|
|
|
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) {
|