123456789101112131415161718192021222324252627282930313233343536373839 |
- package models
- import (
- "github.com/beego/beego/v2/client/orm"
- "time"
- )
- type CygxArticleApplyAppointmentExpert struct {
- Id int `gorm:"column:id;primary_key;AUTO_INCREMENT" json:"id"`
- ArticleId int `gorm:"column:article_id" json:"article_id"`
- UserId int `gorm:"column:user_id" json:"user_id"`
- Mobile string `gorm:"column:mobile" json:"mobile"`
- Email string `gorm:"column:email" json:"email"`
- CompanyId int `gorm:"column:company_id;default:0" json:"company_id"`
- CompanyName string `gorm:"column:company_name" json:"company_name"`
- RealName string `gorm:"column:real_name" json:"real_name"`
- SellerName string `gorm:"column:seller_name" json:"seller_name"`
- CreateTime time.Time `gorm:"column:create_time" json:"create_time"`
- ModifyTime time.Time `gorm:"column:modify_time" json:"modify_time"`
- RegisterPlatform int `gorm:"column:register_platform;default:1;NOT NULL" json:"register_platform"`
- }
- func AddCygxArticleApplyAppointmentExpert(item *CygxArticleApplyAppointmentExpert) (lastId int64, err error) {
- o := orm.NewOrm()
- lastId, err = o.Insert(item)
- return
- }
- func GetCygxArticleApplyAppointmentExpertCount(condition string, pars []interface{}) (count int, err error) {
- sqlCount := ` SELECT COUNT(1) AS count FROM cygx_article_apply_appointment_expert WHERE 1= 1 `
- if condition != "" {
- sqlCount += condition
- }
- o := orm.NewOrm()
- err = o.Raw(sqlCount, pars).QueryRow(&count)
- return
- }
|