sequelize와 node.js를 사용하고 있습니다. PrimaryPractice 모델의 열 값을 서로 연결하고 싶습니다. 이 문제를 어떻게 해결할 수 있습니까? 이것은 내 코드입니다.
ProviderPayer.findAll({
where: {
orgPayerId: {
[Op.in]: orgPayerIds
}
},
attributes: ["effective_date"],
include: [{
model: PayerTracks,
attributes: ["title"],
as: "payers",
},
{
model: User,
where: {
id: {[Op.in]: userIds},
deletedAt: null,
status: {[Op.ne]: STATUS.INACTIVE}
},
attributes: ["id"],
include: [
{
model: PrimaryPractice,
as: "primaryPractice",
attributes: [
"addressStreetPrimPract",
"addressStreet2PrimPract",
"addressCityPrimPract",
"addressStatePrimPract",
"addressZipPrimPract"]
}
]
}
]
})
DBMS에 CONCAT
기능 과 같은 것이 있으면 다음과 같이 시도 할 수 있습니다.
attributes: [
[
sequelize.fn('CONCAT',
sequelize.col('addressStreetPrimPract'), ', ',
sequelize.col('addressStreet2PrimPract'), ', ',
sequelize.col('addressCityPrimPract'), ', ',
sequelize.col('addressStatePrimPract'), ', ',
sequelize.col('addressZipPrimPract')
),
'concatenated_fields_alias'
],
],
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다