fix
wangpengfei
2023-07-13 946da611e1c74bbf133e03adcca3534ec306b01f
fix

Add correlation and display of ServiceFollowup and CustomerServiceSheet
2个文件已修改
46 ■■■■ 已修改文件
model/customerServiceSheet.go 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
model/serviceFollowup.go 31 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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 {
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:联系人id"`
        ServiceId    int    `json:"serviceId" gorm:"column:service_id;type:int;comment:客户服务单id"`
        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:解决率"`
        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:联系人id"`
        ServiceId            int                  `json:"serviceId" gorm:"column:service_id;type:int;comment:客户服务单id"`
        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:解决率"`
        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
}