|
@@ -288,7 +288,7 @@ module.exports = app => {
|
|
|
*/
|
|
|
async getUsedData(tid, cid) {
|
|
|
if (this.ctx.stage.status === audit.stage.status.checked) {
|
|
|
- const sql = 'SELECT scf.*, cal.unit_price ' +
|
|
|
+ const sql = 'SELECT scf.* ' +
|
|
|
' FROM ' + this.tableName + ' scf ' +
|
|
|
' LEFT JOIN ' + this.ctx.service.stage.tableName + ' s ON scf.sid = s.id' +
|
|
|
' WHERE scf.tid = ? And scf.cid = ? And s.order = ?';
|
|
@@ -303,8 +303,8 @@ module.exports = app => {
|
|
|
}
|
|
|
|
|
|
async getFinalUsedData(tid, cid) {
|
|
|
- if (stage.status === audit.stage.status.checked) {
|
|
|
- const sql = 'SELECT scf.*, cal.unit_price ' +
|
|
|
+ if (this.ctx.stage.status === audit.stage.status.checked) {
|
|
|
+ const sql = 'SELECT scf.* ' +
|
|
|
' FROM ' + this.ctx.service.stageChangeFinal.tableName + ' scf ' +
|
|
|
' LEFT JOIN ' + this.ctx.service.stage.tableName + ' s ON scf.sid = s.id' +
|
|
|
' WHERE scf.tid = ? And scf.cid = ? And s.order <= ?';
|
|
@@ -316,8 +316,8 @@ module.exports = app => {
|
|
|
' LEFT JOIN ' + this.ctx.service.stage.tableName + ' s ON scf.sid = s.id' +
|
|
|
' WHERE scf.tid = ? And scf.cid = ? And s.order < ?';
|
|
|
const pre = await this.db.query(preSql, [tid, cid, stage.order]);
|
|
|
- const sql = 'SELECT * FROM ' + this.tableName + ' WHERE sid = ? AND (stimes * 100 + sorder) <= (? * 100 + ?)';
|
|
|
- const curAll = await this.db.query(sql, [this.ctx.stage.id, this.ctx.stage.curTimes, this.ctx.stage.curOrder]);
|
|
|
+ const sql = 'SELECT * FROM ' + this.tableName + ' WHERE sid';
|
|
|
+ const curAll = await this.db.query(sql, [this.ctx.stage.id]);
|
|
|
const cur = this.ctx.helper.filterLastestData(curAll, ['lid', 'pid', 'cid', 'cbid'], 'stimes', 'sorder');
|
|
|
return [...pre, ...cur];
|
|
|
}
|
|
@@ -410,7 +410,7 @@ module.exports = app => {
|
|
|
|
|
|
async _getChangeBillsWithUsedInfo(stage) {
|
|
|
if (stage.status === audit.stage.status.checked) {
|
|
|
- const sql = 'SELECT scf.*, cal.unit_price ' +
|
|
|
+ const sql = 'SELECT scf.* ' +
|
|
|
' FROM ' + this.ctx.service.stageChangeFinal.tableName + ' scf ' +
|
|
|
' LEFT JOIN ' + this.ctx.service.stage.tableName + ' s ON scf.sid = s.id' +
|
|
|
' WHERE scf.tid = ? And s.order <= ?';
|