|
@@ -59,7 +59,12 @@ module.exports = app => {
|
|
|
* @returns {Promise<*>}
|
|
|
*/
|
|
|
async getAuditorStageData(tid, sid, times, order, pid) {
|
|
|
- let pidSql = pid ? (' And Pos.pid in (' + (pid instanceof Array ? pid.join(', ') : pid) + ')') : '';
|
|
|
+ let pidSql;
|
|
|
+ if (pid instanceof Array) {
|
|
|
+ pidSql = pid.length > 0 ? ' And Pos.pid in (' + pid.join(', ') + ')' : '';
|
|
|
+ } else {
|
|
|
+ pidSql = 'And Pos.pid = ' + pid.toString();
|
|
|
+ }
|
|
|
const sql = 'SELECT * FROM ' + this.tableName + ' As Pos ' +
|
|
|
' INNER JOIN ( ' +
|
|
|
' SELECT MAX(`times`) As `times`, MAX(`order`) As `order`, `pid` From ' + this.tableName +
|