company_contract.go 1.1 KB

1234567891011121314151617181920212223242526
  1. package company
  2. import (
  3. "github.com/beego/beego/v2/client/orm"
  4. "time"
  5. )
  6. type CompanyContractPermission struct {
  7. Id int `orm:"column(id);pk" description:"客户合同id"`
  8. CompanyId int `description:"客户id"`
  9. CompanyContractId int `description:"合同id"`
  10. ChartPermissionId int `description:"权限id"`
  11. IsUpgrade int `description:"是否升级,1是,0否"`
  12. ExpensiveYx int `description:"权益研选: 0-3w; 1-5w"`
  13. StartDate string `description:"开始日期"`
  14. EndDate string `description:"结束日期"`
  15. CreateTime time.Time `description:"创建时间"`
  16. ModifyTime time.Time `description:"修改时间"`
  17. }
  18. func GetCompanyContractPermissionCheck(companyContractId, permissionId int) (count int, err error) {
  19. o := orm.NewOrmUsingDB("weekly_report")
  20. sql := `SELECT COUNT(1) AS count FROM company_contract_permission AS a WHERE a.company_contract_id=? AND a.chart_permission_id=? `
  21. err = o.Raw(sql, companyContractId, permissionId).QueryRow(&count)
  22. return
  23. }