123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- package models
- import (
- "github.com/beego/beego/v2/client/orm"
- "time"
- )
- type CygxYanxuanSpecialFollow struct {
- CygxYanxuanSpecialFollowId int `orm:"column(cygx_yanxuan_special_follow_id);pk"`
- UserId int // 用户ID
- FollowUserId int // 被关注用户ID
- Mobile string // 手机号
- Email string // 邮箱
- CompanyId int // 公司ID
- CompanyName string // 公司名称
- RealName string // 用户实际名称
- SellerName string // 所属销售
- CreateTime time.Time // 创建时间
- ModifyTime time.Time // 修改时间
- RegisterPlatform int // 来源 1小程序,2:网页
- YanxuanSpecialId int // cygx_yanxuan_special 表主键ID
- }
- type FollowCygxYanxuanSpecialReq struct {
- FollowUserId int // 被关注的用户id
- Status int // 1关注2取消关注
- SpecialId int // 研选专栏Id
- }
- func AddCygxYanxuanSpecialFollow(item *CygxYanxuanSpecialFollow) (err error) {
- o := orm.NewOrm()
- _, err = o.Insert(item)
- return
- }
- func DelCygxYanxuanSpecialFollow(userId, followUserId int) (err error) {
- o := orm.NewOrm()
- sql := `DELETE FROM cygx_yanxuan_special_follow WHERE user_id=? AND follow_user_id=? `
- _, err = o.Raw(sql, userId, followUserId).Exec()
- return
- }
- func GetCygxYanxuanSpecialFollowOpenIdList(followUserId int) (items []*OpenIdList, err error) {
- o := orm.NewOrm()
- sql := `SELECT
- cr.*,
- c.user_id
- FROM
- user_record AS c
- INNER JOIN cygx_user_record AS cr ON cr.union_id = c.union_id
- INNER JOIN cygx_yanxuan_special_follow AS cf ON cf.user_id = c.user_id
- AND cf.follow_user_id = ?
- WHERE
- create_platform = 4 `
- _, err = o.Raw(sql, followUserId).QueryRows(&items)
- return
- }
|