|
@@ -79,7 +79,7 @@ module.exports = app => {
|
|
|
'SELECT la.`audit_id`, pa.`name`, pa.`company`, pa.`role`, pa.`mobile`, pa.`telephone`, la.`times`, la.`audit_order`, la.`status`, la.`opinion`, la.`begin_time`, la.`end_time`, g.`sort` ' +
|
|
|
'FROM ?? AS la, ?? AS pa, (SELECT `audit_id`,(@i:=@i+1) as `sort` FROM ??, (select @i:=0) as it WHERE `rid` = ? AND `times` = ? GROUP BY `audit_id`) as g ' +
|
|
|
'WHERE la.`rid` = ? and la.`times` = ? and la.`audit_id` = pa.`id` and g.`audit_id` = la.`audit_id` order by la.`audit_order`';
|
|
|
- const sqlParam = [this.tableName, this.ctx.service.projectAccount.tableName, this.tableName, rid, times, rid, times]
|
|
|
+ const sqlParam = [this.tableName, this.ctx.service.projectAccount.tableName, this.tableName, rid, times, rid, times];
|
|
|
const result = await this.db.query(sql, sqlParam);
|
|
|
const sql2 = 'SELECT COUNT(a.`audit_id`) as num FROM (SELECT `audit_id` FROM ?? WHERE `rid` = ? AND `times` = ? GROUP BY `audit_id`) as a';
|
|
|
const sqlParam2 = [this.tableName, rid, times];
|
|
@@ -297,10 +297,10 @@ module.exports = app => {
|
|
|
this.ctx.service.pos.tableName +
|
|
|
' (id, tid, lid, name, drawing_code, quantity, add_stage, add_times, add_user,' +
|
|
|
' sgfh_qty, sjcl_qty, qtcl_qty, crid, porder, position, ' +
|
|
|
- ' sgfh_expr, sjcl_expr, qtcl_expr, gxby_status, dagl_status)' +
|
|
|
+ ' sgfh_expr, sjcl_expr, qtcl_expr, real_qty, gxby_status, dagl_status)' +
|
|
|
' Select id, tid, lid, name, drawing_code, quantity, add_stage, add_times, add_user,' +
|
|
|
' sgfh_qty, sjcl_qty, qtcl_qty, crid, porder, position,' +
|
|
|
- ' sgfh_expr, sjcl_expr, qtcl_expr, gxby_status, dagl_status' +
|
|
|
+ ' sgfh_expr, sjcl_expr, qtcl_expr, real_qty, gxby_status, dagl_status' +
|
|
|
' From ' +
|
|
|
this.ctx.service.revisePos.tableName +
|
|
|
' Where `tid` = ?';
|
|
@@ -528,18 +528,10 @@ module.exports = app => {
|
|
|
' r.id, r.corder, r.uid, r.status, r.content,' +
|
|
|
' t.id As t_id, t.`name` As t_name, t.`project_id` As t_pid, t.`type` As t_type, t.`user_id` As t_uid, t.`status` As t_status, ' +
|
|
|
' p.name As audit_name, p.role As audit_role, p.company As audit_company' +
|
|
|
- ' FROM ' +
|
|
|
- this.tableName +
|
|
|
- ' AS ra' +
|
|
|
- ' Left Join ' +
|
|
|
- this.ctx.service.ledgerRevise.tableName +
|
|
|
- ' As r On ra.rid = r.id' +
|
|
|
- ' Left Join ' +
|
|
|
- this.ctx.service.tender.tableName +
|
|
|
- ' AS t On r.tid = t.id' +
|
|
|
- ' Left Join ' +
|
|
|
- this.ctx.service.projectAccount.tableName +
|
|
|
- ' As p On ra.audit_id = p.id' +
|
|
|
+ ' FROM ' + this.tableName + ' AS ra' +
|
|
|
+ ' Left Join ' + this.ctx.service.ledgerRevise.tableName + ' As r On ra.rid = r.id' +
|
|
|
+ ' Left Join ' + this.ctx.service.tender.tableName + ' AS t On r.tid = t.id' +
|
|
|
+ ' Left Join ' + this.ctx.service.projectAccount.tableName + ' As p On ra.audit_id = p.id' +
|
|
|
' WHERE r.`valid` != 0 and ((ra.`audit_id` = ? and ra.`status` = ?) OR' +
|
|
|
' (r.`uid` = ? and r.`status` = ? and ra.`status` = ? and ra.`times` = (r.`times`-1))) ORDER BY ra.`begin_time` DESC';
|
|
|
const sqlParam = [auditorId, auditConst.status.checking, auditorId, auditConst.status.checkNo, auditConst.status.checkNo];
|