forked from ttc/micro-service-api
ProjectSearch*: initial (working)
Signed-off-by: supphakitd <67319010028@technictrang.ac.th>
This commit is contained in:
@@ -29,19 +29,17 @@ export class projectSearch {
|
||||
let token = req.headers.authorization?.split(' ')[1];
|
||||
const decoded = verifyToken(token);
|
||||
|
||||
let id = decoded.id
|
||||
let username = decoded.name
|
||||
database = decoded.organization
|
||||
let columnParams = req.query.column
|
||||
var column = ""
|
||||
if(columnParams == 'edit'){
|
||||
column = `prjnam, prjwntbdg`
|
||||
condition['prjseq'] = req.body.request.bdgseq
|
||||
condition['prjseq'] = req.body.request.prjseq
|
||||
} else if(columnParams == 'result' || columnParams == undefined || columnParams == ''){
|
||||
column = `prjnam, prjttl`
|
||||
column = `prjseq, prjnam, prjwntbdg, prjacpbdg, prjbdgcod, prjcomstt, prjacpdtm`
|
||||
}
|
||||
|
||||
aryResult = await this.projectSearchService.getProjectSearch(database, id, column, condition);
|
||||
aryResult = await this.projectSearchService.getProjectSearch(database, column, condition);
|
||||
|
||||
} catch (error) {
|
||||
idx = 1;
|
||||
|
||||
@@ -6,7 +6,7 @@ export class ProjectSearchService {
|
||||
this.generalService = new GeneralService()
|
||||
}
|
||||
|
||||
async getProjectSearch(database, id, column, condition) {
|
||||
async getProjectSearch(database, column, condition) {
|
||||
const sql = `
|
||||
SELECT
|
||||
${column}
|
||||
|
||||
Reference in New Issue
Block a user