|
@@ -14,17 +14,22 @@ const (
|
|
|
)
|
|
|
|
|
|
type CrmFinancialAnalyst struct {
|
|
|
- Id int `gorm:"primaryKey;autoIncrement;column:id;comment:主键"`
|
|
|
+ Id int `orm:"pk" gorm:"primaryKey;autoIncrement;column:id;comment:主键"`
|
|
|
ETAId int `gorm:"column:eta_id"`
|
|
|
HTId int `gorm:"column:ht_id"`
|
|
|
Name string `gorm:"column:name"`
|
|
|
- HeadImgURL string `gorm:"column:head_img_url"`
|
|
|
+ HeadImgURL string `orm:"column(head_img_url)" gorm:"column:head_img_url"`
|
|
|
Introduction string `gorm:"column:introduction"`
|
|
|
Status AnalystStatus `gorm:"column:status"`
|
|
|
Deleted bool `gorm:"column:deleted"`
|
|
|
CreatedTime time.Time `gorm:"column:created_time;type:timestamps;comment:创建时间"`
|
|
|
UpdatedTime time.Time `gorm:"column:updated_time;type:timestamps;comment:更新时间"`
|
|
|
}
|
|
|
+
|
|
|
+func (m *CrmFinancialAnalyst) TableName() string {
|
|
|
+ return "crm_financial_analysts"
|
|
|
+}
|
|
|
+
|
|
|
type AnalystView struct {
|
|
|
Id int `json:"Id"`
|
|
|
Name string `json:"Name"`
|
|
@@ -53,3 +58,22 @@ func GetAnalystList(startSize int, pageSize int) (item []*CrmFinancialAnalyst, e
|
|
|
_, err = o.Raw(sql, startSize, pageSize).QueryRows(&item)
|
|
|
return
|
|
|
}
|
|
|
+
|
|
|
+// GetAnalystById
|
|
|
+// @Description: 根据ID获取信息
|
|
|
+// @author: Roc
|
|
|
+// @datetime 2024-08-09 18:24:58
|
|
|
+// @param id int
|
|
|
+// @return analyst CrmFinancialAnalyst
|
|
|
+// @return err error
|
|
|
+func GetAnalystById(id int) (analyst CrmFinancialAnalyst, err error) {
|
|
|
+ o := orm.NewOrm()
|
|
|
+ sql := `SELECT * FROM crm_financial_analysts where id =?`
|
|
|
+ err = o.Raw(sql, id).QueryRow(&analyst)
|
|
|
+ return
|
|
|
+}
|
|
|
+func (m *CrmFinancialAnalyst) Update(cols []string) (err error) {
|
|
|
+ o := orm.NewOrm()
|
|
|
+ _, err = o.Update(m, cols...)
|
|
|
+ return
|
|
|
+}
|