| | |
| | | SaleChanceId int `json:"sale_chance_id" gorm:"column:sale_chance_id;type:int(11);comment:销售机会id"` |
| | | Creator int `json:"creator" gorm:"column:creator;type:int(11);comment:创建人"` |
| | | Modifier int `json:"modifier" gorm:"column:modifier;type:int(11);comment:修改人"` |
| | | EstimatedCollectionDate string `json:"estimated_collection_date" gorm:"column:estimated_collection_date;type:datetime;comment:预计收款日期"` |
| | | EstimatedCollectionDate *string `json:"estimated_collection_date" gorm:"column:estimated_collection_date;type:datetime;comment:预计收款日期"` |
| | | EstimatedCollectionAmount float64 `json:"estimated_collection_amount" gorm:"column:estimated_collection_amount;type:decimal(10,2);comment:预计收款金额"` |
| | | gorm.Model |
| | | } |
| | |
| | | return |
| | | } |
| | | |
| | | func (slf *CollectionProjectionSearch) Find() (record CollectionProjection, err error) { |
| | | func (slf *CollectionProjectionSearch) Find() (int64, error, []*CollectionProjection) { |
| | | var db = slf.build() |
| | | err = db.First(&record).Error |
| | | return |
| | | var records = make([]*CollectionProjection, 0) |
| | | var total int64 |
| | | if err := db.Count(&total).Error; err != nil { |
| | | return total, err, records |
| | | } |
| | | if slf.PageNum > 0 && slf.PageSize > 0 { |
| | | db = db.Offset((slf.PageNum - 1) * slf.PageSize).Limit(slf.PageSize) |
| | | } |
| | | |
| | | err := db.Find(&records).Error |
| | | return total, err, records |
| | | } |
| | | |
| | | func (slf *CollectionProjectionSearch) SetID(id int) *CollectionProjectionSearch { |