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];
|
let token = req.headers.authorization?.split(' ')[1];
|
||||||
const decoded = verifyToken(token);
|
const decoded = verifyToken(token);
|
||||||
|
|
||||||
let id = decoded.id
|
|
||||||
let username = decoded.name
|
|
||||||
database = decoded.organization
|
database = decoded.organization
|
||||||
let columnParams = req.query.column
|
let columnParams = req.query.column
|
||||||
var column = ""
|
var column = ""
|
||||||
if(columnParams == 'edit'){
|
if(columnParams == 'edit'){
|
||||||
column = `prjnam, prjwntbdg`
|
column = `prjnam, prjwntbdg`
|
||||||
condition['prjseq'] = req.body.request.bdgseq
|
condition['prjseq'] = req.body.request.prjseq
|
||||||
} else if(columnParams == 'result' || columnParams == undefined || columnParams == ''){
|
} 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) {
|
} catch (error) {
|
||||||
idx = 1;
|
idx = 1;
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ export class ProjectSearchService {
|
|||||||
this.generalService = new GeneralService()
|
this.generalService = new GeneralService()
|
||||||
}
|
}
|
||||||
|
|
||||||
async getProjectSearch(database, id, column, condition) {
|
async getProjectSearch(database, column, condition) {
|
||||||
const sql = `
|
const sql = `
|
||||||
SELECT
|
SELECT
|
||||||
${column}
|
${column}
|
||||||
|
|||||||
Reference in New Issue
Block a user