| | |
| | | Name string `json:"name" gorm:"column:name;type:varchar(255);comment:公司名称"` |
| | | Number string `json:"number" gorm:"column:number;type:varchar(255);comment:销售线索编号"` |
| | | ContactId int `json:"contact_id" gorm:"column:contact_id;type:int(11);comment:联系人ID"` |
| | | Contact Contact `json:"contact" gorm:"foreignKey:ContactId;references:Id"` |
| | | 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"` |
| | |
| | | Threats string `json:"threats" gorm:"column:threats;type:text;comment:竞争威胁"` |
| | | DetailAddress string `json:"detail_address" gorm:"column:detail_address;type:text;comment:详细地址"` |
| | | Remark string `json:"remark" gorm:"column:remark;type:text;comment:备注"` |
| | | 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 `json:"sales_sources"` |
| | |
| | | db = db.Limit(slf.PageSize).Offset((slf.PageNum - 1) * slf.PageSize) |
| | | } |
| | | |
| | | err := db.Preload("SaleType").Preload("RegularCustomers").Preload("SalesSources").Preload("Member").Preload("SaleStage").Preload("Possibility").Preload("CollectionProjections").Preload("Client").Preload("Province").Preload("City").Order("id desc").Find(&records).Error |
| | | err := db.Preload("SaleType").Preload("RegularCustomers").Preload("SalesSources"). |
| | | Preload("Member").Preload("SaleStage").Preload("Possibility"). |
| | | Preload("CollectionProjections").Preload("Client"). |
| | | Preload("Province").Preload("City").Preload("Contact").Order("id desc").Find(&records).Error |
| | | return records, total, err |
| | | } |
| | | |