company_approval.go 1.6 KB

123456789101112131415161718192021222324252627282930313233
  1. package company
  2. import (
  3. "github.com/beego/beego/v2/client/orm"
  4. "time"
  5. )
  6. type CompanyApproval struct {
  7. CompanyApprovalId int `orm:"column(company_approval_id);pk"`
  8. CompanyId int
  9. ProductId int
  10. ApproveStatus string `description:"'待审批','已审批','驳回','已撤回'"`
  11. ApproveUserId int `description:"审批人"`
  12. ApproveRoleTypeCode string `description:"审批人角色类型"`
  13. ApproveRealName string `description:"审批人姓名"`
  14. ApproveTime time.Time `description:"审批时间"`
  15. ApproveContent string `description:"待审内容"`
  16. ApplyMethod int `description:"申请类型:1:试用->正式,2:冻结—>试用,3:试用延期,4:原销售申请领取流失客户,5:正式客户申请服务更新,6:正式客户补充协议"`
  17. ApplyReasons string `description:"申请原因"`
  18. ApplyUserId int `description:"申请人"`
  19. ApplyRealName string `description:"申请人姓名"`
  20. CreateTime time.Time `description:"申请时间"`
  21. ModifyTime time.Time `description:"修改时间"`
  22. CompanyContractId int `description:"合同id"`
  23. IsFormal int `description:"是否已经转正式,0是没有转正式,1是已经转过正式"`
  24. }
  25. func GetCompanyApprovalById(companyId int) (item *CompanyApproval, err error) {
  26. sql := `SELECT * FROM company_approval WHERE company_id=? AND product_id=2 AND approve_status='已审批' order by company_approval_id desc LIMIT 1 `
  27. o := orm.NewOrmUsingDB("weekly_report")
  28. err = o.Raw(sql, companyId).QueryRow(&item)
  29. return
  30. }