|
@@ -106,6 +106,24 @@ module.exports = app => {
|
|
|
throw err;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ async getAllCert(tenderId) {
|
|
|
+ const sql = 'SELECT tc.uid, tc.cert_id, tc.department, tc.job_time, tc.remark,' +
|
|
|
+ ' ac.type, ac.name as ac_name, ac.code, ac.reg_unit, ac.job_title, ac.file_name, ac.file_path, ac.edu_json,' +
|
|
|
+ ' pa.account, pa.name, pa.role, pa.company' +
|
|
|
+ ` FROM ${this.tableName} tc LEFT JOIN ${this.ctx.service.accountCert.tableName} ac ON tc.cert_id = ac.id` +
|
|
|
+ ` LEFT JOIN ${this.ctx.service.projectAccount.tableName} pa ON tc.uid = pa.id` +
|
|
|
+ ' WHERE tc.tid = ?';
|
|
|
+ const result = await this.db.query(sql, [tenderId]);
|
|
|
+ result.forEach(x => {
|
|
|
+ x.edu_json = x.edu_json ? JSON.parse(x.edu_json) : [];
|
|
|
+ const eduInfo = x.edu_json.length > 0 ? x.edu_json[x.edu_json.length - 1] : null;
|
|
|
+ for (const prop in eduInfo) {
|
|
|
+ x['edu_info_' + prop] = eduInfo[prop];
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return result;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
return TenderCert;
|