12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- package cygx
- import (
- "github.com/beego/beego/v2/client/orm"
- "time"
- )
- type CygxRaiServeWeekBill struct {
- ServeWeekBillId int `orm:"column(serve_week_bill_id);pk" description:"服务周账单ID"`
- CompanyId int `comment:"公司ID"`
- CompanyName string `comment:"公司名称"`
- UserTotal int `comment:"用户数量"`
- WeekServeCount float64 `comment:"周度服务量总计"`
- CoverageRate float64 `comment:"覆盖率"`
- WeekStartDate string `comment:"周一开始日期"`
- WeekEndDate string `comment:"周日结束日期"`
- CreateTime time.Time `comment:"创建时间"`
- ModifyTime time.Time `comment:"修改时间"`
- }
- // 最近四周覆盖率列表
- func GetCygxRaiServeBillListWeek4(companyId int) (items []*CygxRaiServeWeekBill, err error) {
- o := orm.NewOrmUsingDB("hz_cygx")
- sql := `SELECT * FROM cygx_rai_serve_week_bill WHERE company_id = ? ORDER BY week_start_date DESC LIMIT 4 `
- _, err = o.Raw(sql, companyId).QueryRows(&items)
- return
- }
- // 权益服务明细表
- type CygxRaiCompanyUserBill struct {
- BillId int `orm:"column(bill_id);pk" description:"服务明细主键ID"`
- Content string `comment:"服务内容说明"`
- ServeTypeId int `comment:"服务类型ID"`
- ServeTypeName string `comment:"服务类型"`
- UserId int `comment:"用户ID"`
- Mobile string `comment:"手机号"`
- Email string `comment:"邮箱"`
- CompanyId int `comment:"公司ID"`
- CompanyName string `comment:"公司名称"`
- RealName string `comment:"用户实际名称"`
- RegisterPlatform int `comment:"来源 1小程序,2:网页"`
- ServeCount float64 `comment:"服务量小计"`
- IsKp int `comment:"是否是KP,1:是、0:否"`
- SourceId int `comment:"来源ID"`
- Source string `comment:"来源 "`
- WeekStartDate string `comment:"周一开始日期"`
- WeekEndDate string `comment:"周日结束日期"`
- ChartPermissionId int `description:"行业id"`
- ChartPermissionName string `description:"行业名称"`
- CreateTime time.Time `comment:"创建时间"`
- ViewTime string `comment:"浏览时间"`
- ViewTimes time.Time `comment:"浏览时间"`
- }
- // 列表
- func GetCygxRaiCompanyUserBillListAll(condition string, pars []interface{}) (items []*CygxRaiCompanyUserBill, err error) {
- if condition == "" {
- return
- }
- o := orm.NewOrmUsingDB("hz_cygx")
- sql := `SELECT company_id ,serve_count ,view_time as view_time FROM cygx_rai_company_user_bill WHERE 1= 1 `
- if condition != "" {
- sql += condition
- }
- _, err = o.Raw(sql, pars).QueryRows(&items)
- return
- }
|