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