|
@@ -147,7 +147,7 @@ module.exports = app => {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
async getStageUsedBills(tid, sid) {
|
|
async getStageUsedBills(tid, sid) {
|
|
|
- const sql = 'SELECT Bills.lid, ((not IsNull(Bills.contract_qty) and Bills.contract_qty <> 0) or (not IsNull(Bills.contract_tp) and Bills.contract_tp <> 0) or (not IsNull(Bills.qc_qty) and Bills.qc_qty <> 0) or (not IsNull(Bills.qc_tp) and Bills.qc_tp <> 0)) As used' +
|
|
|
|
|
|
|
+ const sql = 'SELECT Bills.lid, ((not IsNull(Bills.contract_qty) and Bills.contract_qty <> 0) or (not IsNull(Bills.contract_tp) and Bills.contract_tp <> 0) or (not IsNull(Bills.qc_qty) and Bills.qc_qty <> 0) or (not IsNull(Bills.qc_tp) and Bills.qc_tp <> 0) or (not IsNull(Bills.qc_minus_qty) and Bills.qc_minus_qty <> 0)) As used' +
|
|
|
' FROM ' + this.tableName + ' As Bills ' +
|
|
' FROM ' + this.tableName + ' As Bills ' +
|
|
|
' INNER JOIN ( ' +
|
|
' INNER JOIN ( ' +
|
|
|
' SELECT MAX(`times` * ' + timesLen + ' + `order`) As `progress`, `lid`, `sid` From ' + this.tableName +
|
|
' SELECT MAX(`times` * ' + timesLen + ' + `order`) As `progress`, `lid`, `sid` From ' + this.tableName +
|