From cddf1d93735052590755460f4b3c8264e0d57399 Mon Sep 17 00:00:00 2001
From: wangpengfei <274878379@qq.com>
Date: 星期一, 07 八月 2023 09:39:20 +0800
Subject: [PATCH] fix

---
 model/serviceFollowup.go |  256 +++++++++++++++++++++++++-------------------------
 1 files changed, 128 insertions(+), 128 deletions(-)

diff --git a/model/serviceFollowup.go b/model/serviceFollowup.go
index de9174d..118ae24 100644
--- a/model/serviceFollowup.go
+++ b/model/serviceFollowup.go
@@ -1,128 +1,128 @@
-package model
-
-import (
-	"aps_crm/pkg/mysqlx"
-	"gorm.io/gorm"
-)
-
-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"`
-		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"`
-		SatisfactionId       int                  `json:"satisfactionId" gorm:"column:satisfaction_id;type:int;comment:婊℃剰搴d"`
-		TimelyRateId         int                  `json:"timelyRateId" gorm:"column:timely_rate_id;type:int;comment:鍙婃椂鐜噄d"`
-		SolveRateId          int                  `json:"solveRateId" gorm:"column:solve_rate_id;type:int;comment:瑙e喅鐜噄d"`
-		IsVisitId            int                  `json:"isVisitId" gorm:"column:is_visit_id;type:int;comment:鏈嶅姟浜哄憳鏄惁鏉ヨ繃id"`
-		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:"-"`
-	}
-
-	ServiceFollowupSearch struct {
-		ServiceFollowup
-
-				Orm      *gorm.DB
-		Keyword  string
-		OrderBy  string
-		PageNum  int
-		PageSize int
-
-	}
-)
-
-func (ServiceFollowup) TableName() string {
-	return "service_followup"
-}
-
-func NewServiceFollowupSearch() *ServiceFollowupSearch {
-	return &ServiceFollowupSearch{
-		Orm: mysqlx.GetDB(),
-	}
-}
-
-func (slf *ServiceFollowupSearch) build() *gorm.DB {
-	var db = slf.Orm.Model(&ServiceFollowup{})
-	if slf.Keyword != "" {
-		db = db.Where("name LIKE ?", "%"+slf.Keyword+"%")
-	}
-	if slf.Id != 0 {
-		db = db.Where("id = ?", slf.Id)
-	}
-
-	return db
-}
-
-func (slf *ServiceFollowupSearch) Create(record *ServiceFollowup) error {
-	var db = slf.build()
-	return db.Create(record).Error
-}
-
-func (slf *ServiceFollowupSearch) Update(record *ServiceFollowup) error {
-	var db = slf.build()
-	return db.Updates(record).Error
-}
-
-func (slf *ServiceFollowupSearch) Delete() error {
-	var db = slf.build()
-	return db.Delete(&ServiceFollowup{}).Error
-}
-
-func (slf *ServiceFollowupSearch) Find() (*ServiceFollowup, error) {
-	var db = slf.build()
-	var record = &ServiceFollowup{}
-	err := db.First(record).Error
-	return record, err
-}
-
-func (slf *ServiceFollowupSearch) FindAll() ([]*ServiceFollowup, int64, error) {
-	var db = slf.build()
-	var records = make([]*ServiceFollowup, 0)
-	var total int64
-	if err := db.Count(&total).Error; err != nil {
-		return records, total, err
-	}
-	if slf.PageNum > 0 && slf.PageSize > 0 {
-		db = db.Limit(slf.PageSize).Offset((slf.PageNum - 1) * slf.PageSize)
-	}
-
-	if slf.PageNum > 0 && slf.PageSize > 0 {
-		db = db.Limit(slf.PageSize).Offset((slf.PageNum - 1) * slf.PageSize)
-	}
-
-	err := db.Preload("CustomerServiceSheet").Find(&records).Error
-	return records, total, err
-}
-
-func (slf *ServiceFollowupSearch) SetId(id int) *ServiceFollowupSearch {
-	slf.Id = id
-	return slf
-}
-
-// 鍙兘鎬� 甯佺 褰撳墠鐘舵�侊紙閿�鍞満浼氾級
-
-func (slf *ServiceFollowupSearch) SetKeyword(keyword string) *ServiceFollowupSearch {
-	slf.Keyword = keyword
-	return slf
-}
-
-func (slf *ServiceFollowupSearch) SetPage(page, size int) *ServiceFollowupSearch {
-	slf.PageNum, slf.PageSize = page, size
-	return slf
-}
-
-func (slf *ServiceFollowupSearch) SetOrder(order string) *ServiceFollowupSearch {
-	slf.OrderBy = order
-	return slf
-}
-func (slf *ServiceFollowupSearch) SetIds(ids []int) *ServiceFollowupSearch {
-	slf.Orm = slf.Orm.Where("id in (?)", ids)
-	return slf
-}
+package model
+
+import (
+	"aps_crm/pkg/mysqlx"
+	"gorm.io/gorm"
+)
+
+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"`
+		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"`
+		SatisfactionId       int                  `json:"satisfactionId" gorm:"column:satisfaction_id;type:int;comment:婊℃剰搴d"`
+		TimelyRateId         int                  `json:"timelyRateId" gorm:"column:timely_rate_id;type:int;comment:鍙婃椂鐜噄d"`
+		SolveRateId          int                  `json:"solveRateId" gorm:"column:solve_rate_id;type:int;comment:瑙e喅鐜噄d"`
+		IsVisitId            int                  `json:"isVisitId" gorm:"column:is_visit_id;type:int;comment:鏈嶅姟浜哄憳鏄惁鏉ヨ繃id"`
+		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:"-"`
+	}
+
+	ServiceFollowupSearch struct {
+		ServiceFollowup
+
+				Orm      *gorm.DB
+		Keyword  string
+		OrderBy  string
+		PageNum  int
+		PageSize int
+
+	}
+)
+
+func (ServiceFollowup) TableName() string {
+	return "service_followup"
+}
+
+func NewServiceFollowupSearch() *ServiceFollowupSearch {
+	return &ServiceFollowupSearch{
+		Orm: mysqlx.GetDB(),
+	}
+}
+
+func (slf *ServiceFollowupSearch) build() *gorm.DB {
+	var db = slf.Orm.Model(&ServiceFollowup{})
+	if slf.Keyword != "" {
+		db = db.Where("name LIKE ?", "%"+slf.Keyword+"%")
+	}
+	if slf.Id != 0 {
+		db = db.Where("id = ?", slf.Id)
+	}
+
+	return db
+}
+
+func (slf *ServiceFollowupSearch) Create(record *ServiceFollowup) error {
+	var db = slf.build()
+	return db.Create(record).Error
+}
+
+func (slf *ServiceFollowupSearch) Update(record *ServiceFollowup) error {
+	var db = slf.build()
+	return db.Updates(record).Error
+}
+
+func (slf *ServiceFollowupSearch) Delete() error {
+	var db = slf.build()
+	return db.Delete(&ServiceFollowup{}).Error
+}
+
+func (slf *ServiceFollowupSearch) Find() (*ServiceFollowup, error) {
+	var db = slf.build()
+	var record = &ServiceFollowup{}
+	err := db.First(record).Error
+	return record, err
+}
+
+func (slf *ServiceFollowupSearch) FindAll() ([]*ServiceFollowup, int64, error) {
+	var db = slf.build()
+	var records = make([]*ServiceFollowup, 0)
+	var total int64
+	if err := db.Count(&total).Error; err != nil {
+		return records, total, err
+	}
+	if slf.PageNum > 0 && slf.PageSize > 0 {
+		db = db.Limit(slf.PageSize).Offset((slf.PageNum - 1) * slf.PageSize)
+	}
+
+	if slf.PageNum > 0 && slf.PageSize > 0 {
+		db = db.Limit(slf.PageSize).Offset((slf.PageNum - 1) * slf.PageSize)
+	}
+
+	err := db.Preload("CustomerServiceSheet").Find(&records).Error
+	return records, total, err
+}
+
+func (slf *ServiceFollowupSearch) SetId(id int) *ServiceFollowupSearch {
+	slf.Id = id
+	return slf
+}
+
+// 鍙兘鎬� 甯佺 褰撳墠鐘舵�侊紙閿�鍞満浼氾級
+
+func (slf *ServiceFollowupSearch) SetKeyword(keyword string) *ServiceFollowupSearch {
+	slf.Keyword = keyword
+	return slf
+}
+
+func (slf *ServiceFollowupSearch) SetPage(page, size int) *ServiceFollowupSearch {
+	slf.PageNum, slf.PageSize = page, size
+	return slf
+}
+
+func (slf *ServiceFollowupSearch) SetOrder(order string) *ServiceFollowupSearch {
+	slf.OrderBy = order
+	return slf
+}
+func (slf *ServiceFollowupSearch) SetIds(ids []int) *ServiceFollowupSearch {
+	slf.Orm = slf.Orm.Where("id in (?)", ids)
+	return slf
+}

--
Gitblit v1.8.0