package cygx

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

type AskEmailRep struct {
	Name                string `description:"姓名"`
	Email               string `description:"邮箱"`
	Mobile              string `description:"手机号"`
	ChartPermissionName string `description:"权限名称"`
}

func GetAskEmail() (item []*AskEmailRep, err error) {
	o := orm.NewOrmUsingDB("hz_cygx")
	sql := `SELECT * FROM cygx_activity_ask_email`
	_, err = o.Raw(sql).QueryRows(&item)
	return
}

func GetAskEmailList() (item []*AskEmailRep, err error) {
	o := orm.NewOrmUsingDB("hz_cygx")
	sql := `SELECT * FROM cygx_activity_ask_email WHERE    chart_permission_name != ''  ORDER BY sort  DESC`
	_, err = o.Raw(sql).QueryRows(&item)
	return
}
