From d3c6646d3d2c7297a2f857bca63d23423c892b7c Mon Sep 17 00:00:00 2001 From: zhangqian <zhangqian@123.com> Date: 星期六, 05 八月 2023 15:19:12 +0800 Subject: [PATCH] 回访单关联服务单 --- model/serviceFollowup.go | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/model/serviceFollowup.go b/model/serviceFollowup.go index 23fda19..757b182 100644 --- a/model/serviceFollowup.go +++ b/model/serviceFollowup.go @@ -13,6 +13,7 @@ Number string `json:"number" gorm:"column:number;type:varchar(255);comment:鍚堝悓缂栧彿"` ContactId int `json:"contactId" gorm:"column:contact_id;type:int;comment:鑱旂郴浜篿d"` ServiceId int `json:"serviceId" gorm:"column:service_id;type:int;comment:瀹㈡埛鏈嶅姟鍗昳d"` + ServiceOrder ServiceOrder `gorm:"foreignKey:ServiceId"` CustomerServiceSheet CustomerServiceSheet `json:"customerServiceSheet" gorm:"foreignKey:ServiceId"` MemberId int `json:"memberId" gorm:"column:member_id;type:int;comment:鏈嶅姟浜哄憳id"` PlanId int `json:"planId" gorm:"column:plan_id;type:int;comment:鏈嶅姟璁″垝id"` @@ -110,7 +111,7 @@ db = db.Limit(slf.PageSize).Offset((slf.PageNum - 1) * slf.PageSize) } - err := db.Preload("CustomerServiceSheet").Find(&records).Error + err := db.Preload("CustomerServiceSheet").Preload("ServiceOrder").Find(&records).Error return records, total, err } -- Gitblit v1.8.0