12345678910111213141516171819202122232425262728293031323334353637383940 |
- package cygx
- import (
- "github.com/beego/beego/v2/client/orm"
- "time"
- )
- type CompanyReportPermission struct {
- CompanyReportPermissionId int64 `orm:"column(company_report_permission_id);pk"`
- CompanyId int
- ReportPermissionId int
- CreatedTime time.Time
- LastUpdatedTime time.Time
- ChartPermissionId int
- StartDate string `description:"权限开始日期"`
- EndDate string `description:"权限结束日期"`
- ProductId int `description:"产品id"`
- ProductName string `description:"产品名称"`
- CompanyContractId int `description:"合同id"`
- Status string `description:"'正式','试用','关闭'"`
- ModifyTime time.Time `description:"修改时间"`
- IsUpgrade int `description:"是否升级,1是,0否"`
- ExpensiveYx int `description:"权益研选: 0-3w; 1-5w"`
- }
- // GetCompanyReportPermission 获取权限类型
- func GetCompanyReportPermission(companyId, productId int) (items []*CompanyReportPermission, err error) {
- o := orm.NewOrm()
- sql := `SELECT
- re.*
- FROM
- company_report_permission as re
- INNER JOIN chart_permission as c ON c.chart_permission_id = re.chart_permission_id
- WHERE
- re.company_id = ?
- AND re.product_id = ?
- AND STATUS = '正式' `
- _, err = o.Raw(sql, companyId, productId).QueryRows(&items)
- return
- }
|