From f264456b1e4fd284f53ecc4c70a3b951578bfd2d Mon Sep 17 00:00:00 2001
From: wangpengfei <274878379@qq.com>
Date: 星期五, 18 八月 2023 17:13:05 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 model/client.go |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/model/client.go b/model/client.go
index f68f542..084854d 100644
--- a/model/client.go
+++ b/model/client.go
@@ -10,7 +10,8 @@
 type (
 	Client struct {
 		Id                int            `json:"id" gorm:"column:id;primaryKey;autoIncrement;not null"`
-		Name              string         `json:"name" gorm:"column:name;unique;type:varchar(255);comment:瀹㈡埛鍚嶇О"`
+		Name              string         `json:"name" gorm:"column:name;uniqueIndex:name_isDeleted_idx;type:varchar(255);comment:瀹㈡埛鍚嶇О"`
+		IsDeleted         bool           `json:"-" gorm:"column:is_deleted;uniqueIndex:name_isDeleted_idx;type:tinyint(1);comment:鏄惁鍒犻櫎"`
 		Number            string         `json:"number" gorm:"column:number;type:varchar(255);comment:瀹㈡埛缂栧彿"`
 		ClientStatusId    int            `json:"client_status_id" gorm:"column:client_status_id;type:int(11);comment:瀹㈡埛鐘舵�両D"`
 		ClientStatus      ClientStatus   `json:"client_status" gorm:"foreignKey:ClientStatusId"`
@@ -26,12 +27,13 @@
 		ServiceMemberId   int            `json:"service_member_id" gorm:"column:service_member_id;type:int(11);comment:鏈嶅姟璐熻矗浜篒D"`
 		DetailAddress     string         `json:"detail_address" gorm:"column:detail_address;type:varchar(255);comment:璇︾粏鍦板潃"`
 		Remark            string         `json:"remark" gorm:"column:remark;type:varchar(255);comment:澶囨敞"`
+		CreatorId         int            `json:"creator_id" gorm:"column:creator_id;type:int;comment:鍒涘缓浜篿d"`
 		NextVisitTime     *CustomTime    `json:"next_visit_time" gorm:"column:next_visit_time;type:datetime;comment:涓嬫鍥炶鏃堕棿"`
 		LatestServiceTime *CustomTime    `json:"latest_service_time" gorm:"column:latest_service_time;type:datetime;comment:鏈�鏅氭湇鍔℃椂闂�"`
 		FollowRecord      []FollowRecord `json:"follow_record" gorm:"foreignKey:ClientId"`
 		Address
 		Business
-		gorm.Model `json:"-"`
+		gormModel
 	}
 
 	ClientSearch struct {
@@ -133,6 +135,7 @@
 
 func (slf *ClientSearch) Delete() error {
 	var db = slf.build()
+	db.Update("is_deleted", 1)
 	return db.Delete(&Client{}).Error
 }
 

--
Gitblit v1.8.0