From 724674c54da32406a16264850c3719b2553aada6 Mon Sep 17 00:00:00 2001 From: wangpengfei <274878379@qq.com> Date: 星期四, 10 八月 2023 19:35:36 +0800 Subject: [PATCH] Merge branch 'master' into fly --- model/serviceContract.go | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/model/serviceContract.go b/model/serviceContract.go index 14a5e7a..0b64a4f 100644 --- a/model/serviceContract.go +++ b/model/serviceContract.go @@ -26,9 +26,9 @@ Quotation Quotation `json:"quotation" gorm:"foreignKey:QuotationId"` ServiceContractTypeId int `json:"serviceContractTypeId" gorm:"column:service_contract_type_id;type:int;comment:鍚堝悓绫诲瀷id"` ServiceContractType ServiceContractType `json:"serviceContractType" gorm:"foreignKey:ServiceContractTypeId"` - SignTime string `json:"signTime" gorm:"column:sign_time;type:datetime;comment:绛剧害鏃堕棿"` - StartTime string `json:"startTime" gorm:"column:start_time;type:datetime;comment:寮�濮嬫椂闂�"` - EndTime string `json:"endTime" gorm:"column:end_time;type:datetime;comment:缁撴潫鏃堕棿"` + SignTime string `json:"signTime" gorm:"column:sign_time;type:varchar(255);comment:绛剧害鏃堕棿"` + StartTime string `json:"startTime" gorm:"column:start_time;type:varchar(255);comment:寮�濮嬫椂闂�"` + EndTime string `json:"endTime" gorm:"column:end_time;type:varchar(255);comment:缁撴潫鏃堕棿"` ServiceContractStatusId int `json:"serviceContractStatusId" gorm:"column:service_contract_status_id;type:int;comment:鍚堝悓鐘舵�乮d"` ServiceContractStatus ServiceContractStatus `json:"serviceContractStatus" gorm:"foreignKey:ServiceContractStatusId"` ServiceTimes int `json:"serviceTimes" gorm:"column:service_times;type:int;comment:鏈嶅姟娆℃暟"` @@ -96,7 +96,7 @@ case constvar.ServiceContractKeywordPrincipal: db = db.Joins("left join user on user.id = service_contract.member_id").Where("user.username like ?", fmt.Sprintf("%%%s%%", slf.Keyword)) case constvar.ServiceContractKeywordProductName: - db = db.Joins("Products", clause.LeftJoin).Where("Products.name like ?", fmt.Sprintf("%%%s%%", slf.Keyword)) + db = db.Joins("left join service_contract_product scp on scp.service_contract_id = service_contract.id left join products on scp.product_id = products.id").Where("products.name like ?", fmt.Sprintf("%%%s%%", slf.Keyword)) case constvar.ServiceContractKeywordServiceBeginDate: db = db.Where("start_time = ?", slf.Keyword) case constvar.ServiceContractKeywordServiceEndDate: -- Gitblit v1.8.0