zhangqian
2023-08-11 ae6883ce426727efca4facab973d814ae66c69c2
model/saleChance.go
@@ -3,7 +3,6 @@
import (
   "aps_crm/pkg/mysqlx"
   "gorm.io/gorm"
   "time"
)
type (
@@ -23,7 +22,7 @@
      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           int       `json:"currency" gorm:"column:currency;type:int(11);comment:币种"`
      ExpectedTime       time.Time `json:"expected_time" gorm:"column:expected_time;type:datetime;comment:预计成交时间"`
      ExpectedTime          *CustomTime            `json:"expected_time" gorm:"column:expected_time;type:datetime;comment:预计成交时间"`
      StatusId           int       `json:"status_id" gorm:"column:status_id;type:int(11);comment:状态ID"`
      PainPoints         string    `json:"pain_points" gorm:"column:pain_points;type:text;comment:痛点"`
      WhetherEstablished string    `json:"whether_established" gorm:"column:whether_established;type:text;comment:是否成立"`
@@ -40,6 +39,7 @@
      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
      Address
      gorm.Model `json:"-"`
@@ -114,7 +114,7 @@
      db = db.Limit(slf.PageSize).Offset((slf.PageNum - 1) * slf.PageSize)
   }
   err := db.Preload("Client").Preload("Contact").Find(&records).Error
   err := db.Preload("CollectionProjections").Preload("Client").Preload("Contact").Find(&records).Error
   return records, total, err
}