From 7ffcc41e597c5af4169e3e2ab809fdbf869c2154 Mon Sep 17 00:00:00 2001
From: wangpengfei <274878379@qq.com>
Date: 星期二, 18 七月 2023 16:08:47 +0800
Subject: [PATCH] add
---
model/saleChance.go | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/model/saleChance.go b/model/saleChance.go
index 7848b68..40f3d40 100644
--- a/model/saleChance.go
+++ b/model/saleChance.go
@@ -20,7 +20,7 @@
MemberId int `json:"member_id" gorm:"column:member_id;type:int(11);comment:閿�鍞礋璐d汉ID"`
RegularCustomersId int `json:"regular_customers_id" gorm:"column:regular_customers_id;type:int(11);comment:甯稿ID"`
Competitors string `json:"competitors" gorm:"column:competitors;type:varchar(255);comment:绔炰簤瀵规墜"`
- Possibilities int `json:"possibilities" gorm:"column:possibilities;type:int(11);comment:鍙兘鎬�"`
+ PossibilitiesId int `json:"possibilities_id" gorm:"column:possibilities_id;type:int(11);comment:鍙兘鎬D"`
Budget float64 `json:"budget" gorm:"column:budget;type:decimal(10,2);comment:棰勭畻"`
ProjectedAmount float64 `json:"projected_amount" gorm:"column:projected_amount;type:decimal(10,2);comment:棰勮閲戦"`
Currency constvar.CurrencyType `json:"currency" gorm:"column:currency;type:int(11);comment:璐у竵绫诲瀷"`
@@ -37,6 +37,9 @@
Disadvantages string `json:"disadvantages" gorm:"column:disadvantages;type:text;comment:绔炰簤鍔e娍"`
Opportunities string `json:"opportunities" gorm:"column:opportunities;type:text;comment:绔炰簤鏈轰細"`
Threats string `json:"threats" gorm:"column:threats;type:text;comment:绔炰簤濞佽儊"`
+ Contact Contact `json:"contact" gorm:"foreignKey:ContactId;references:Id"`
+ Client Client `json:"client" gorm:"foreignKey:ClientId;references:Id"`
+ SalesSources SalesSources
Address
gorm.Model `json:"-"`
}
@@ -93,7 +96,7 @@
func (slf *SaleChangeSearch) FindAll() (record []*SaleChance, err error) {
var db = slf.build()
- err = db.Find(&record).Error
+ err = db.Preload("Client").Preload("Contact").Find(&record).Error
return
}
--
Gitblit v1.8.0