|
@@ -117,7 +117,7 @@ module.exports = app => {
|
|
|
|
|
|
sql = 'SELECT la.`audit_id`, pa.`name`, pa.`company`, pa.`role`, la.`times`, la.`tender_id`, la.audit_order, la.audit_type, la.audit_ledger_id ' +
|
|
sql = 'SELECT la.`audit_id`, pa.`name`, pa.`company`, pa.`role`, la.`times`, la.`tender_id`, la.audit_order, la.audit_type, la.audit_ledger_id ' +
|
|
' FROM ?? AS la Left Join ?? AS pa On la.`audit_id` = pa.`id` ' +
|
|
' FROM ?? AS la Left Join ?? AS pa On la.`audit_id` = pa.`id` ' +
|
|
- ' WHERE la.`sid` = ? and la.`audit_order` = ? and la.`times` = ?';
|
|
|
|
|
|
+ ' WHERE la.`tender_id` = ? and la.`audit_order` = ? and la.`times` = ?';
|
|
sqlParam = [this.tableName, this.ctx.service.projectAccount.tableName, tenderId, cur.order, parseInt(times) - 1];
|
|
sqlParam = [this.tableName, this.ctx.service.projectAccount.tableName, tenderId, cur.order, parseInt(times) - 1];
|
|
auditor = await this.db.query(sql, sqlParam);
|
|
auditor = await this.db.query(sql, sqlParam);
|
|
break;
|
|
break;
|
|
@@ -977,7 +977,7 @@ module.exports = app => {
|
|
const existAudit = auditList.find(x => { return x.audit_id === lastId });
|
|
const existAudit = auditList.find(x => { return x.audit_id === lastId });
|
|
let order = auditList.length > 0 ? auditList.reduce((rst, a) => { return Math.max(rst, a.audit_order)}, 0) + 1 : 1; // 最大值 + 1
|
|
let order = auditList.length > 0 ? auditList.reduce((rst, a) => { return Math.max(rst, a.audit_order)}, 0) + 1 : 1; // 最大值 + 1
|
|
if (existAudit) {
|
|
if (existAudit) {
|
|
- await transaction.delete(this.tableName, { sid: stage.id, times: stage.times, audit_id: lastId });
|
|
|
|
|
|
+ await transaction.delete(this.tableName, { tender_id: tender.id, times: tender.ledger_times, audit_id: lastId });
|
|
const sameOrder = auditList.filter(x => { return x.audit_order === existAudit.audit_order });
|
|
const sameOrder = auditList.filter(x => { return x.audit_order === existAudit.audit_order });
|
|
if (sameOrder.length === 1) {
|
|
if (sameOrder.length === 1) {
|
|
const updateData = [];
|
|
const updateData = [];
|