company_approval.go 1.5 KB

123456789101112131415161718192021222324252627282930313233
  1. package company_approval
  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. }
  24. //根据合同id获取审批单
  25. func GetCompanyApprovalByCompanyContractId(companyContractId int) (item *CompanyApproval, err error) {
  26. o := orm.NewOrm()
  27. sql := `SELECT * FROM company_approval WHERE company_contract_id=? order by company_approval_id desc`
  28. err = o.Raw(sql, companyContractId).QueryRow(&item)
  29. return
  30. }