company_source.go 544 B

123456789101112131415161718192021222324
  1. package models
  2. import (
  3. "github.com/beego/beego/v2/client/orm"
  4. )
  5. type CompanySource struct {
  6. SourceId int `orm:"column(source_id);pk"`
  7. SourceName string `description:"来源名称"`
  8. }
  9. // 客户来源列表
  10. type CompanySourceListResp struct {
  11. List []*CompanySource `description:"客户来源列表"`
  12. }
  13. // 获取来源列表
  14. func GetAllCompanySourceList() (items []*CompanySource, err error) {
  15. sql := ``
  16. sql = `SELECT * FROM company_source ORDER BY sort DESC `
  17. o := orm.NewOrm()
  18. _, err = o.Raw(sql).QueryRows(&items)
  19. return
  20. }