From 946da611e1c74bbf133e03adcca3534ec306b01f Mon Sep 17 00:00:00 2001 From: wangpengfei <274878379@qq.com> Date: 星期四, 13 七月 2023 15:24:28 +0800 Subject: [PATCH] fix --- model/serviceFollowup.go | 31 ++++++++++++++++--------------- 1 files changed, 16 insertions(+), 15 deletions(-) diff --git a/model/serviceFollowup.go b/model/serviceFollowup.go index 86818d4..d05e848 100644 --- a/model/serviceFollowup.go +++ b/model/serviceFollowup.go @@ -7,20 +7,21 @@ type ( ServiceFollowup struct { - Id int `json:"id" gorm:"column:id;primary_key;AUTO_INCREMENT"` - ClientId int `json:"clientId" gorm:"column:client_id;type:int;comment:瀹㈡埛id"` - 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"` - MemberId int `json:"memberId" gorm:"column:member_id;type:int;comment:鏈嶅姟浜哄憳id"` - PlanId int `json:"planId" gorm:"column:plan_id;type:int;comment:鏈嶅姟璁″垝id"` - Satisfaction int `json:"satisfaction" gorm:"column:satisfaction;type:int;comment:婊℃剰搴�"` - TimelyRate int `json:"timelyRate" gorm:"column:timely_rate;type:int;comment:鍙婃椂鐜�"` - SolveRate int `json:"solveRate" gorm:"column:solve_rate;type:int;comment:瑙e喅鐜�"` - IsVisit int `json:"isVisit" gorm:"column:is_visit;type:int;comment:鏈嶅姟浜哄憳鏄惁鏉ヨ繃"` - OldMemberId int `json:"oldMemberId" gorm:"column:old_member_id;type:int;comment:鍘熸湇鍔′汉鍛�"` - Remark string `json:"remark" gorm:"column:remark;type:text;comment:澶囨敞"` - File string `json:"file" gorm:"column:file;type:varchar(255);comment:闄勪欢"` + Id int `json:"id" gorm:"column:id;primary_key;AUTO_INCREMENT"` + ClientId int `json:"clientId" gorm:"column:client_id;type:int;comment:瀹㈡埛id"` + 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"` + 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"` + Satisfaction int `json:"satisfaction" gorm:"column:satisfaction;type:int;comment:婊℃剰搴�"` + TimelyRate int `json:"timelyRate" gorm:"column:timely_rate;type:int;comment:鍙婃椂鐜�"` + SolveRate int `json:"solveRate" gorm:"column:solve_rate;type:int;comment:瑙e喅鐜�"` + IsVisit int `json:"isVisit" gorm:"column:is_visit;type:int;comment:鏈嶅姟浜哄憳鏄惁鏉ヨ繃"` + OldMemberId int `json:"oldMemberId" gorm:"column:old_member_id;type:int;comment:鍘熸湇鍔′汉鍛�"` + Remark string `json:"remark" gorm:"column:remark;type:text;comment:澶囨敞"` + File string `json:"file" gorm:"column:file;type:varchar(255);comment:闄勪欢"` gorm.Model `json:"-"` } @@ -75,7 +76,7 @@ func (slf *ServiceFollowupSearch) FindAll() ([]*ServiceFollowup, error) { var db = slf.build() var records = make([]*ServiceFollowup, 0) - err := db.Find(&records).Error + err := db.Preload("CustomerServiceSheet").Find(&records).Error return records, err } -- Gitblit v1.8.0