package report

import (
	"github.com/beego/beego/v2/client/orm"
)

func GetUserReportFiccCount(mobile string) (count int, err error) {
	o := orm.NewOrm()
	sql := `SELECT COUNT(1) as count
			FROM company_report_permission crp
			INNER JOIN wx_user wu ON wu.company_id = crp.company_id 
			WHERE wu.mobile IN (` + mobile + `) AND crp.product_id = 1 AND status IN  ('正式','试用','永续') `
	err = o.Raw(sql).QueryRow(&count)
	return
}
