|  | @@ -1003,16 +1003,9 @@ module.exports = app => {
 | 
	
		
			
				|  |  |                  } else {
 | 
	
		
			
				|  |  |                      const material = this.ctx.helper._.find(materials, {order: material_order});
 | 
	
		
			
				|  |  |                      if (!material) return [];
 | 
	
		
			
				|  |  | -                    const sql = 'SELECT m.id, m.tid, m.mid, m.t_type, m.code, m.name, m.unit, m.spec, m.m_type,' +
 | 
	
		
			
				|  |  | -                        '    m.basic_price, m.basic_times, m.remark, m.in_time, m.m_tax, m.m_tax_tp, m.tax_pre_tp,' +
 | 
	
		
			
				|  |  | -                        '    mh.quantity, mh.expr, mh.msg_tp, mh.msg_times, mh.msg_spread, mh.m_up_risk, mh.m_down_risk, mh.m_spread' +
 | 
	
		
			
				|  |  | -                        '  FROM ' + this.ctx.service.materialBills.tableName + ' m' +
 | 
	
		
			
				|  |  | -                        '  LEFT JOIN ' + this.ctx.service.materialBillsHistory.tableName + ' mh' +
 | 
	
		
			
				|  |  | -                        '  ON m.id = mh.mb_id' +
 | 
	
		
			
				|  |  | -                        '  WHERE mh.mid = ?';
 | 
	
		
			
				|  |  | -                    const sqlParam = [material.id];
 | 
	
		
			
				|  |  | -                    result = await this.ctx.app.mysql.query(sql, sqlParam);
 | 
	
		
			
				|  |  | -                    console.log(result);
 | 
	
		
			
				|  |  | +                    result = await this.ctx.service.materialBillsHistory.getAllDataByCondition({
 | 
	
		
			
				|  |  | +                        where: { tid: tender_id, mid: material.id }
 | 
	
		
			
				|  |  | +                    });
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  |                  this._completeMaterialGl(result);
 | 
	
		
			
				|  |  |                  return result;
 |