entity_name:GWM
This commit is contained in:
parent
65c4651913
commit
1d86263f94
@ -16,9 +16,9 @@ exports.mainLandingPage = async (req, res) =>
|
|||||||
if(req.query.is_loan_api_call == 0)
|
if(req.query.is_loan_api_call == 0)
|
||||||
{
|
{
|
||||||
LoanDetail.findAll({raw: true ,where:{ losid:req.query.losid , is_active : 1},
|
LoanDetail.findAll({raw: true ,where:{ losid:req.query.losid , is_active : 1},
|
||||||
include: [{ model: ApplicantsDetails , // Set the alias for the relationship
|
include: [{ model: EntityDetails , // Set the alias for the relationship
|
||||||
attributes: [
|
attributes: [
|
||||||
[sequelize.col('name'), 'loan_applicant_name'] // Alias for the 'name' column
|
[sequelize.col('entity_name'), 'loan_applicant_name'] // Alias for the 'name' column
|
||||||
] }] }).then(data =>
|
] }] }).then(data =>
|
||||||
{
|
{
|
||||||
if(data.length > 0)
|
if(data.length > 0)
|
||||||
@ -60,9 +60,9 @@ exports.mainLandingPage = async (req, res) =>
|
|||||||
ModuleWiseStatusHelper.moduleCompletionStatusDataCreationHelper(loanDetailData.loginNo);
|
ModuleWiseStatusHelper.moduleCompletionStatusDataCreationHelper(loanDetailData.loginNo);
|
||||||
// Final Response
|
// Final Response
|
||||||
LoanDetail.findAll({raw: true ,where:{ losid:req.query.losid , is_active : 1},
|
LoanDetail.findAll({raw: true ,where:{ losid:req.query.losid , is_active : 1},
|
||||||
include: [{ model: ApplicantsDetails , // Set the alias for the relationship
|
include: [{ model: EntityDetails , // Set the alias for the relationship
|
||||||
attributes: [
|
attributes: [
|
||||||
[sequelize.col('name'), 'loan_applicant_name'] // Alias for the 'name' column
|
[sequelize.col('entity_name'), 'loan_applicant_name'] // Alias for the 'name' column
|
||||||
] }] }).then(data => { if(data.length > 0) { res.send({'status':200,'message':"success",'data':data}); } else { res.send({'status':404,'message':"failed",'data':"No data"}); } })
|
] }] }).then(data => { if(data.length > 0) { res.send({'status':200,'message':"success",'data':data}); } else { res.send({'status':404,'message':"failed",'data':"No data"}); } })
|
||||||
|
|
||||||
// Entity detail promise
|
// Entity detail promise
|
||||||
@ -179,9 +179,9 @@ exports.mainLandingPage = async (req, res) =>
|
|||||||
{
|
{
|
||||||
logMsg.info("Los api call Failed " +req.query.losid);
|
logMsg.info("Los api call Failed " +req.query.losid);
|
||||||
LoanDetail.findAll({raw: true ,where:{ losid:req.query.losid , is_active : 1},
|
LoanDetail.findAll({raw: true ,where:{ losid:req.query.losid , is_active : 1},
|
||||||
include: [{ model: ApplicantsDetails , // Set the alias for the relationship
|
include: [{ model: EntityDetails , // Set the alias for the relationship
|
||||||
attributes: [
|
attributes: [
|
||||||
[sequelize.col('name'), 'loan_applicant_name'] // Alias for the 'name' column
|
[sequelize.col('entity_name'), 'loan_applicant_name'] // Alias for the 'name' column
|
||||||
] }] }).then(data =>
|
] }] }).then(data =>
|
||||||
{
|
{
|
||||||
if(data.length > 0)
|
if(data.length > 0)
|
||||||
@ -203,9 +203,9 @@ exports.mainLandingPage = async (req, res) =>
|
|||||||
logMsg.info("Data already inserted " +req.query.losid);
|
logMsg.info("Data already inserted " +req.query.losid);
|
||||||
// Final Response
|
// Final Response
|
||||||
LoanDetail.findAll({raw: true ,where:{ losid:req.query.losid , is_active : 1},
|
LoanDetail.findAll({raw: true ,where:{ losid:req.query.losid , is_active : 1},
|
||||||
include: [{ model: ApplicantsDetails , // Set the alias for the relationship
|
include: [{ model: EntityDetails , // Set the alias for the relationship
|
||||||
attributes: [
|
attributes: [
|
||||||
[sequelize.col('name'), 'loan_applicant_name'] // Alias for the 'name' column
|
[sequelize.col('entity_name'), 'loan_applicant_name'] // Alias for the 'name' column
|
||||||
] }] }).then(data =>
|
] }] }).then(data =>
|
||||||
{
|
{
|
||||||
if(data.length > 0)
|
if(data.length > 0)
|
||||||
|
|||||||
@ -44,6 +44,10 @@ module.exports = (sequelize, DataTypes) => {
|
|||||||
foreignKey: 'loan_no_id',
|
foreignKey: 'loan_no_id',
|
||||||
sourceKey : 'id'
|
sourceKey : 'id'
|
||||||
});
|
});
|
||||||
|
LoanDetail.hasMany(models.EntityDetails, {
|
||||||
|
foreignKey: 'loan_no_id',
|
||||||
|
sourceKey : 'id'
|
||||||
|
});
|
||||||
}
|
}
|
||||||
return LoanDetail
|
return LoanDetail
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue
Block a user