package cygx

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

type CygxUserBusinessCard struct {
	UserId           int       `comment:"用户ID"`
	Mobile           string    `comment:"手机号"`
	Email            string    `comment:"邮箱"`
	CompanyName      string    `comment:"公司名称"`
	RealName         string    `comment:"用户实际名称"`
	InviteName       string    `comment:"用户实际名称"`
	CreateTime       time.Time `comment:"创建时间"`
	ModifyTime       time.Time `comment:"修改时间"`
	RegisterPlatform int       `comment:"来源 1小程序，2：网页"`
}

func GetCygxUserBusinessCardList(condition string, pars []interface{}, startSize, pageSize int) (items []*CygxUserBusinessCard, err error) {
	o := orm.NewOrmUsingDB("hz_cygx")
	sql := `SELECT *
			FROM
			cygx_user_business_card
			WHERE 1 = 1 ` + condition
	sql += ` LIMIT ?,?  `
	_, err = o.Raw(sql, pars, startSize, pageSize).QueryRows(&items)
	return
}
