From d4bf53dd19a45ef09a367babcf7a2ac04ae1d08f Mon Sep 17 00:00:00 2001 From: liujiandao <274878379@qq.com> Date: 星期二, 17 十月 2023 14:31:31 +0800 Subject: [PATCH] bug修改 --- model/contract.go | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-) diff --git a/model/contract.go b/model/contract.go index 2597428..93519c3 100644 --- a/model/contract.go +++ b/model/contract.go @@ -8,6 +8,7 @@ type ( Contract struct { Id int `json:"id" gorm:"column:id;primary_key;AUTO_INCREMENT"` + ContractName string `json:"contractName" gorm:"column:contract_name;type:varchar(255);comment:鍚堝悓鍚嶇О"` ClientId int `json:"clientId" gorm:"column:client_id;type:int;comment:瀹㈡埛id"` Client Client `json:"client" gorm:"foreignKey:ClientId"` MemberId int `json:"memberId" gorm:"column:member_id;type:int;comment:璐熻矗浜篿d"` @@ -19,6 +20,7 @@ ServiceContractStatus ServiceContractStatus `json:"serviceContractStatus" gorm:"foreignKey:StatusId;references:Id"` File string `json:"file" gorm:"column:file;type:varchar(255);comment:鍚堝悓鏂囦欢"` CreatedAt *CustomTime `json:"created_at" gorm:"column:created_at;type:datetime;comment:鍒涘缓鏃堕棿"` + CodeStandID string `json:"codeStandID" gorm:"column:code_stand_id;type:varchar(255);comment:缂栫爜id"` gormModel } @@ -70,6 +72,9 @@ db = db.Where(key+"= ?", v) } case int: + if key == "member_id" { + db = db.Where(key+"= ?", v) + } } } } @@ -141,3 +146,7 @@ slf.Orm = slf.Orm.Where("id in (?)", ids) return slf } +func (slf *ContractSearch) UpdateByMap(data map[string]interface{}) error { + var db = slf.build() + return db.Updates(data).Error +} -- Gitblit v1.8.0