From c92534229c83436ffe9e6752209200dd70b77808 Mon Sep 17 00:00:00 2001
From: wangpengfei <274878379@qq.com>
Date: 星期四, 17 八月 2023 19:19:44 +0800
Subject: [PATCH] add
---
model/saleChance.go | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/model/saleChance.go b/model/saleChance.go
index 1f54c8d..175ac2a 100644
--- a/model/saleChance.go
+++ b/model/saleChance.go
@@ -14,11 +14,13 @@
ClientId int `json:"client_id" gorm:"column:client_id;type:int(11);comment:瀹㈡埛ID"`
SalesSourcesId int `json:"sales_sources_id" gorm:"column:sales_sources_id;type:int(11);comment:鍟嗘満鏉ユ簮ID"`
SaleTypeId int `json:"sale_type_id" gorm:"column:sale_type_id;type:int(11);comment:鍟嗘満绫诲瀷ID"`
+ SaleType SaleType `json:"sale_type" `
SaleStageId int `json:"sale_stage_id" gorm:"column:sale_stage_id;type:int(11);comment:鍟嗘満闃舵ID"`
SaleStage SaleStage `json:"sale_stage" gorm:"foreignKey:SaleStageId;references:Id"`
MemberId int `json:"member_id" gorm:"column:member_id;type:int(11);comment:閿�鍞礋璐d汉ID"`
Member User `json:"member" gorm:"foreignKey:MemberId"`
RegularCustomersId int `json:"regular_customers_id" gorm:"column:regular_customers_id;type:int(11);comment:甯稿ID"`
+ RegularCustomers RegularCustomers `json:"regular_customers"`
Competitors string `json:"competitors" gorm:"column:competitors;type:varchar(255);comment:绔炰簤瀵规墜"`
PossibilitiesId int `json:"possibilities_id" gorm:"column:possibilities_id;type:int(11);comment:鍙兘鎬D"`
Possibility Possibility `json:"possibility" gorm:"foreignKey:PossibilitiesId;references:Id"`
@@ -43,7 +45,7 @@
Contact Contact `json:"contact" gorm:"foreignKey:ContactId;references:Id"`
Client Client `json:"client" gorm:"foreignKey:ClientId;references:Id"`
CollectionProjections []CollectionProjection `json:"collection_projections" gorm:"foreignKey:SaleChanceId"`
- SalesSources SalesSources
+ SalesSources SalesSources `json:"sales_sources"`
Address
gorm.Model `json:"-"`
}
@@ -155,7 +157,7 @@
db = db.Limit(slf.PageSize).Offset((slf.PageNum - 1) * slf.PageSize)
}
- err := db.Preload("SalesSources").Preload("Member").Preload("SaleStage").Preload("Possibility").Preload("CollectionProjections").Preload("Client").Preload("Contact").Find(&records).Error
+ err := db.Preload("SaleType").Preload("RegularCustomers").Preload("SalesSources").Preload("Member").Preload("SaleStage").Preload("Possibility").Preload("CollectionProjections").Preload("Client").Preload("Contact").Order("id desc").Find(&records).Error
return records, total, err
}
--
Gitblit v1.8.0