| 
					
				 | 
			
			
				@@ -320,13 +320,15 @@ module.exports = app => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 case 0: // 包含你的所有变更令 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     const sql = 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         'SELECT count(*) AS count FROM ?? AS a WHERE a.tid = ? AND ' + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        '(a.uid = ? OR a.cid IN (SELECT b.cid FROM ?? AS b WHERE b.uid = ? AND a.times = b.times GROUP BY b.cid))'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        '(a.uid = ? OR (a.status != ? AND a.cid IN (SELECT b.cid FROM ?? AS b WHERE b.uid = ? AND a.times = b.times GROUP BY b.cid)) OR a.status = ? )'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     const sqlParam = [ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         this.tableName, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         tenderId, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         this.ctx.session.sessionUser.accountId, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        audit.flow.status.uncheck, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         this.ctx.service.changeAudit.tableName, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         this.ctx.session.sessionUser.accountId, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        audit.flow.status.checked, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     ]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     const result = await this.db.query(sql, sqlParam); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     return result[0].count; 
			 |