123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- package models
- import (
- "github.com/beego/beego/v2/client/orm"
- "github.com/rdlucklib/rdluck_tools/paging"
- "time"
- )
- type CygxMorningMeetingGather struct {
- Id int `orm:"column(id);pk"`
- MeetingIds string `description:"主表ID多个用 , 隔开"`
- PublishTime string `description:"发布日期"`
- CreateTime time.Time `description:"创建时间"`
- ModifyTime time.Time `description:"更新时间"`
- Title string `description:"标题"`
- Status int `description:"0:未发布,1:已发布"`
- }
- // 添加
- func AddCygxMorningMeetingGather(item *CygxMorningMeetingGather) (err error) {
- o := orm.NewOrm()
- _, err = o.Insert(item)
- return
- }
- func GetCygxMorningMeetingGatherCount(condition string, pars []interface{}) (count int, err error) {
- o := orm.NewOrm()
- sql := `SELECT COUNT(1) AS count FROM cygx_morning_meeting_gather WHERE 1=1 `
- if condition != "" {
- sql += condition
- }
- err = o.Raw(sql, pars).QueryRow(&count)
- return
- }
- type CygxMorningMeetingGatherResp struct {
- Id int `description:"ID"`
- Title string `description:"标题"`
- SubjectNames string `description:"多个标的名称"`
- }
- type CygxMorningMeetingGatherListResp struct {
- Paging *paging.PagingItem `description:"分页数据"`
- List []*CygxMorningMeetingGatherResp
- }
- // 列表
- func GetCygxMorningMeetingGatherList(condition string, pars []interface{}, startSize, pageSize int) (items []*CygxMorningMeetingGather, err error) {
- o := orm.NewOrm()
- sql := `SELECT * FROM cygx_morning_meeting_gather WHERE 1=1 `
- if condition != "" {
- sql += condition
- }
- sql += ` LIMIT ?,? `
- _, err = o.Raw(sql, pars, startSize, pageSize).QueryRows(&items)
- return
- }
|