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/customerServiceSheet.go | 15 ++++++++-------
model/serviceFollowup.go | 31 ++++++++++++++++---------------
2 files changed, 24 insertions(+), 22 deletions(-)
diff --git a/model/customerServiceSheet.go b/model/customerServiceSheet.go
index 0a91f29..7d759c5 100644
--- a/model/customerServiceSheet.go
+++ b/model/customerServiceSheet.go
@@ -7,13 +7,14 @@
type (
CustomerServiceSheet struct {
- Id int `json:"id" gorm:"column:id;primary_key;AUTO_INCREMENT"`
- MemberId int `json:"memberId" gorm:"column:member_id;type:int;comment:鏈嶅姟浜哄憳id"`
- Number string `json:"number" gorm:"column:number;type:varchar(255);comment:鏈嶅姟鍗曞彿"`
- ServiceMode int `json:"serviceMode" gorm:"column:service_mode;type:int;comment:鏈嶅姟鏂瑰紡"`
- Priority int `json:"priority" gorm:"column:priority;type:int;comment:浼樺厛绾�"`
- HandleStatus int `json:"handleStatus" gorm:"column:handle_status;type:int;comment:澶勭悊鐘舵��"`
- gorm.Model `json:"-"`
+ Id int `json:"id" gorm:"column:id;primary_key;AUTO_INCREMENT"`
+ MemberId int `json:"memberId" gorm:"column:member_id;type:int;comment:鏈嶅姟浜哄憳id"`
+ Number string `json:"number" gorm:"column:number;type:varchar(255);comment:鏈嶅姟鍗曞彿"`
+ ServiceMode int `json:"serviceMode" gorm:"column:service_mode;type:int;comment:鏈嶅姟鏂瑰紡"`
+ Priority int `json:"priority" gorm:"column:priority;type:int;comment:浼樺厛绾�"`
+ HandleStatus int `json:"handleStatus" gorm:"column:handle_status;type:int;comment:澶勭悊鐘舵��"`
+ ServiceFollowupId int `json:"serviceFollowupId" gorm:"column:service_followup_id;type:int;comment:鏈嶅姟璺熻繘id"`
+ gorm.Model `json:"-"`
}
CustomerServiceSheetSearch struct {
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