|
@@ -374,6 +374,16 @@ module.exports = app => {
|
|
|
return this.ctx.helper.filterLastestData(data, ['lid', 'pid', 'cid', 'cbid'], 'stimes', 'sorder');
|
|
|
}
|
|
|
|
|
|
+ async getSumLoadFinalData(sid) {
|
|
|
+ const sql = 'Select cf.tid, cf.sid, cf.lid, cf.cid, cf.cbid, cf.qty, c.code As c_code' +
|
|
|
+ ' FROM ' + this.tableName + ' cf' +
|
|
|
+ ' Left Join ' + this.ctx.service.change.tableName + ' c ON cf.cid = c.cid' +
|
|
|
+ ' Where cf.sid = ?';
|
|
|
+ const result = await this.db.query(sql, [sid]);
|
|
|
+ console.log(this.db.format(sql, [sid]));
|
|
|
+ return this.ctx.helper.filterLastestData(result, ['lid', 'pid', 'cbid'], 'stimes', 'sorder');
|
|
|
+ }
|
|
|
+
|
|
|
async _getTender(stage) {
|
|
|
if (this.ctx.tender) return this.ctx.tender;
|
|
|
const tender = { id: stage.tid };
|