Browse Source

no message

xingzai 1 year ago
parent
commit
5256f8b0eb

+ 300 - 29
controllers/cygx/yanxuan_special.go

@@ -2,12 +2,16 @@ package cygx
 
 import (
 	"encoding/json"
+	"github.com/rdlucklib/rdluck_tools/paging"
+	"github.com/tealeg/xlsx"
 	"hongze/hz_crm_api/controllers"
 	"hongze/hz_crm_api/models"
 	"hongze/hz_crm_api/models/cygx"
 	cygxService "hongze/hz_crm_api/services/cygx"
 	"hongze/hz_crm_api/services/elastic"
 	"hongze/hz_crm_api/utils"
+	"os"
+	"path/filepath"
 	"strconv"
 	"time"
 )
@@ -145,6 +149,12 @@ func (this *YanxuanSpecialController) AuthorEnable() {
 // @Title 作者列表
 // @Description 作者列表
 // @Param	request	body help_doc.AddHelpDocReq true "type json string"
+// @Param   PageSize   query   int  true       "每页数据条数"
+// @Param   CurrentIndex   query   int  true       "当前页页码,从1开始"
+// @Param   Status   query   string  true       "状态: 1:启用 、 2:禁用 。传其他默认所有"
+// @Param   KeyWord   query   string  false       "搜索关键词"
+// @Param   SortParam   query   string  false       "排序字段参数,用来排序的字段, 枚举值:'CreatTime':开通时间 、 'articleNum':已发布文章 、 'pv':总Pv/Uv "
+// @Param   SortType   query   string  true       "如何排序,是正序还是倒序,枚举值:`asc 正序`,`desc 倒叙`"
 // @Success 200 {object} models.AddEnglishReportResp
 // @router /yanxuan_special/author/list [get]
 func (this *YanxuanSpecialController) AuthorList() {
@@ -161,39 +171,101 @@ func (this *YanxuanSpecialController) AuthorList() {
 		return
 	}
 
-	list, tmpErr := cygx.GetYanxuanSpecialAuthorList()
+	pageSize, _ := this.GetInt("PageSize")
+	currentIndex, _ := this.GetInt("CurrentIndex")
+	status, _ := this.GetInt("Status")
+	keyWord := this.GetString("KeyWord")
+	//排序参数
+	sortParam := this.GetString("SortParam")
+	sortType := this.GetString("SortType")
+
+	var startSize int
+	if pageSize <= 0 {
+		pageSize = utils.PageSize20
+	}
+	if currentIndex <= 0 {
+		currentIndex = 1
+	}
+	startSize = utils.StartIndex(currentIndex, pageSize)
+	var condition string
+	var pars []interface{}
+	//作者状态处理
+	if status == 1 || status == 2 {
+		condition += ` AND art.status = ? `
+		pars = append(pars, status)
+	}
+
+	//关键词搜索
+	if keyWord != "" {
+		keyWord = "%" + keyWord + "%"
+		condition += ` AND art.special_name like  ? `
+		pars = append(pars, keyWord)
+	}
+
+	//排序字段以及排序方式处理
+	var sortStr string
+	if sortParam != "" && sortType != "" {
+		if sortParam == "CreatTime" {
+			if sortType == "asc" {
+				sortStr = " ORDER BY art.create_time ASC "
+			} else {
+				sortStr = " ORDER BY art.create_time  DESC "
+			}
+		}
+
+		if sortParam == "articleNum" {
+			if sortType == "asc" {
+				sortStr = " ORDER BY art.article_num ASC "
+			} else {
+				sortStr = " ORDER BY art.article_num  DESC  "
+			}
+		}
+
+		if sortParam == "Pv" {
+			if sortType == "asc" {
+				sortStr = " ORDER BY art.pv ASC "
+			} else {
+				sortStr = " ORDER BY art.pv  DESC "
+			}
+		}
+	} else {
+		sortStr = " ORDER BY art.create_time  DESC "
+	}
+
+	total, err := cygx.GetYanxuanSpecialAuthorCount(condition, pars)
+	if err != nil {
+		br.Msg = "获取失败"
+		br.ErrMsg = "获取失败,Err:" + err.Error()
+		return
+	}
+
+	list, tmpErr := cygx.GetYanxuanSpecialAuthorList(condition+sortStr, pars, startSize, pageSize)
 	if tmpErr != nil {
 		br.Msg = "获取失败"
 		br.ErrMsg = "获取失败, Err:" + tmpErr.Error()
 		return
 	}
-
-	br.Data = list
+	resp := new(cygx.GetCygxYanxuanSpecialAuthorItemResp)
+	page := paging.GetPaging(currentIndex, pageSize, total)
+	resp.List = list
+	resp.Paging = page
+	br.Data = resp
 	br.Ret = 200
 	br.Success = true
 	br.Msg = "获取成功"
 }
 
-//V12.0.1 上线脚本
-//func init() {
-//	list, err := cygx.GetYanxuanSpecialAuthorList()
-//	if err != nil {
-//		fmt.Println(err)
-//	}
-//	for _, v := range list {
-//		//获取关联公司的用户信息
-//		infoUser, err := cygx.GetUserAndCompanyNameList(v.UserId)
-//		if err != nil {
-//			fmt.Println(err)
-//		}
-//		err = cygx.UpdateSpecialAuthorComapony(infoUser.UserId, infoUser.CompanyId, infoUser.CompanyName)
-//		fmt.Println(infoUser.UserId)
-//	}
-//}
-
 // @Title 审核列表
 // @Description 审核列表
-// @Param	request	body help_doc.AddHelpDocReq true "type json string"
+// @Param   PageSize   query   int  true       "每页数据条数"
+// @Param   CurrentIndex   query   int  true       "当前页页码,从1开始"
+// @Param   Status   query   string  true       "状态: 1:待审核 、 2:已发布 。默认待审核"
+// @Param   Type   query   int  true       "文章类型,1:笔记、2:观点"
+// @Param   KeyWord   query   string  false       "搜索关键词"
+// @Param   SortParam   query   string  false       "排序字段参数,用来排序的字段, 枚举值:'CreatTime':开通时间 、 'articleNum':已发布文章 、 'pv':总Pv/Uv "
+// @Param   SortType   query   string  true       "如何排序,是正序还是倒序,枚举值:`asc 正序`,`desc 倒叙`"
+// @Param   StartDate   query   string  false       "开始时间 ,列如2021-03-06 "
+// @Param   EndDate   query   string  false       "结束时间,列如2021-03-06 "
 // @Success 200 {object} models.AddEnglishReportResp
 // @router /yanxuan_special/list [get]
 func (this *YanxuanSpecialController) List() {
@@ -211,6 +283,25 @@ func (this *YanxuanSpecialController) List() {
 	}
 
 	userId, _ := this.GetInt("UserId", 0)
+	pageSize, _ := this.GetInt("PageSize")
+	currentIndex, _ := this.GetInt("CurrentIndex")
+	status, _ := this.GetInt("Status", 1)
+	specialType, _ := this.GetInt("Type", 1)
+	keyWord := this.GetString("KeyWord")
+	//排序参数
+	sortParam := this.GetString("SortParam")
+	sortType := this.GetString("SortType")
+	startDate := this.GetString("StartDate")
+	endDate := this.GetString("EndDate")
+
+	var startSize int
+	if pageSize <= 0 {
+		pageSize = utils.PageSize20
+	}
+	if currentIndex <= 0 {
+		currentIndex = 1
+	}
+	startSize = utils.StartIndex(currentIndex, pageSize)
 	var condition string
 	var pars []interface{}
 
@@ -218,10 +309,55 @@ func (this *YanxuanSpecialController) List() {
 		condition += ` AND a.user_id = ? `
 		pars = append(pars, userId)
 	}
+	if status == 1 {
+		condition += ` AND a.status = 2 `
+	}
+	if status == 2 {
+		condition += ` AND a.status = 3 `
+	}
+
+	if startDate != "" {
+		condition += ` AND a.publish_time >= ` + "'" + startDate + " 00:00:00'"
+	}
+	if endDate != "" {
+		condition += ` AND a.publish_time <= ` + "'" + endDate + " 23:59:59'"
+	}
+
+	//文章类型
+	if specialType == 1 || specialType == 2 {
+		condition += ` AND a.type =  ? `
+		pars = append(pars, specialType)
+	}
+
+	//关键词搜索
+	if keyWord != "" {
+		keyWord = "%" + keyWord + "%"
+		condition += ` AND a.title like  ? `
+		pars = append(pars, keyWord)
+	}
+
+	//排序字段以及排序方式处理
+	var sortStr string
+	if sortParam != "" && sortType != "" {
+		if sortParam == "Pv" {
+			if sortType == "asc" {
+				sortStr = " ORDER BY a.pv ASC "
+			} else {
+				sortStr = " ORDER BY a.pv  DESC "
+			}
+		}
+	} else {
+		sortStr = " ORDER BY a.publish_time  DESC "
+	}
 
-	condition += ` AND a.status = 2 `
+	total, err := cygx.GetGetYanxuanSpecialCount(condition, pars)
+	if err != nil {
+		br.Msg = "获取失败"
+		br.ErrMsg = "获取失败,Err:" + err.Error()
+		return
+	}
 
-	list, tmpErr := cygx.GetYanxuanSpecialList(condition, pars)
+	list, tmpErr := cygx.GetYanxuanSpecialList(condition+sortStr, pars, startSize, pageSize)
 	if tmpErr != nil {
 		br.Msg = "获取失败"
 		br.ErrMsg = "获取失败, Err:" + tmpErr.Error()
@@ -245,11 +381,6 @@ func (this *YanxuanSpecialController) List() {
 			}
 			v.Docs = docs
 		}
-		if v.Type == 1 {
-			v.Title = "【笔记】" + v.Title
-		} else if v.Type == 2 {
-			v.Title = "【观点】" + v.Title
-		}
 		if v.CompanyTags != "" {
 			v.Tags += v.CompanyTags
 		}
@@ -260,8 +391,12 @@ func (this *YanxuanSpecialController) List() {
 			v.Tags += v.IndustryTags
 		}
 	}
+	resp := new(cygx.GetCygxYanxuanSpeciaResplItemResp)
+	page := paging.GetPaging(currentIndex, pageSize, total)
 
-	br.Data = list
+	resp.List = list
+	resp.Paging = page
+	br.Data = resp
 	br.Ret = 200
 	br.Success = true
 	br.Msg = "获取成功"
@@ -322,3 +457,139 @@ func (this *YanxuanSpecialController) Enable() {
 	br.Ret = 200
 	br.Success = true
 }
+
+// @Title 收藏详情
+// @Description 收藏详情
+// @Param   SpecialId    query   int  true       "每页数据条数"
+// @Success 200 {object} models.AddEnglishReportResp
+// @router /yanxuan_special/special_collect/list [get]
+func (this *YanxuanSpecialController) SpecialCollectList() {
+	br := new(models.BaseResponse).Init()
+	defer func() {
+		this.Data["json"] = br
+		this.ServeJSON()
+	}()
+	sysUser := this.SysUser
+	if sysUser == nil {
+		br.Msg = "请登录"
+		br.ErrMsg = "请登录,SysUser Is Empty"
+		br.Ret = 408
+		return
+	}
+	specialId, _ := this.GetInt("SpecialId")
+	var condition string
+	var pars []interface{}
+	condition += " AND yanxuan_special_id = ?  	ORDER BY art.create_time DESC  "
+	pars = append(pars, specialId)
+	list, err := cygx.GetCygxYanxuanSpecialCollectList(condition, pars, 0, 100000)
+	if err != nil {
+		br.Msg = "获取失败"
+		br.ErrMsg = "获取失败,Err:" + err.Error()
+		return
+	}
+	resp := new(cygx.GetCygxYanxuanSpecialCollectResp)
+	resp.List = list
+	br.Data = resp
+	br.Ret = 200
+	br.Success = true
+	br.Msg = "获取成功"
+}
+
+// @Title  下载PV
+// @Description 下载PV接口
+// @Param   SpecialId    query   int  true       "每页数据条数"
+// @router /yanxuan_special/list_pv [get]
+func (this *YanxuanSpecialController) ListPv() {
+	br := new(models.BaseResponse).Init()
+	defer func() {
+		this.Data["json"] = br
+		this.ServeJSON()
+	}()
+	AdminUser := this.SysUser
+	if AdminUser == nil {
+		br.Msg = "请登录"
+		br.ErrMsg = "请登录,用户信息为空"
+		br.Ret = 408
+		return
+	}
+	specialId, _ := this.GetInt("SpecialId")
+	if specialId < 1 {
+		br.Msg = "请输入专栏ID"
+		return
+	}
+	var condition string
+	var pars []interface{}
+	condition = ` AND yanxuan_special_id = ?   ORDER BY create_time DESC  `
+	pars = append(pars, specialId)
+
+	list, err := cygx.GetCygxYanxuanSpecialRecordList(condition, pars)
+	if err != nil {
+		br.Msg = "获取失败"
+		br.ErrMsg = "获取数据失败,Err:" + err.Error()
+		return
+	}
+	//创建excel
+	dir, err := os.Executable()
+	exPath := filepath.Dir(dir)
+	downLoadnFilePath := exPath + "/" + time.Now().Format(utils.FormatDateTimeUnSpace) + ".xlsx"
+	xlsxFile := xlsx.NewFile()
+	if err != nil {
+		br.Msg = "生成文件失败"
+		br.ErrMsg = "生成文件失败"
+		return
+	}
+	style := xlsx.NewStyle()
+	alignment := xlsx.Alignment{
+		Horizontal: "center",
+		Vertical:   "center",
+		WrapText:   true,
+	}
+	style.Alignment = alignment
+	style.ApplyAlignment = true
+	sheet, err := xlsxFile.AddSheet("阅读明细")
+	if err != nil {
+		br.Msg = "新增Sheet失败"
+		br.ErrMsg = "新增Sheet失败,Err:" + err.Error()
+		return
+	}
+	rowTitle := sheet.AddRow()
+	cellA := rowTitle.AddCell()
+	cellA.Value = "姓名"
+	cellB := rowTitle.AddCell()
+	cellB.Value = "公司名称"
+	cellC := rowTitle.AddCell()
+	cellC.Value = "所属权益销售"
+	cellD := rowTitle.AddCell()
+	cellD.Value = "阅读时间"
+	cellE := rowTitle.AddCell()
+	cellE.Value = "阅读时长"
+
+	for _, item := range list {
+		row := sheet.AddRow()
+		cellA := row.AddCell()
+		cellA.Value = item.RealName
+		cellB := row.AddCell()
+		cellB.Value = item.CompanyName
+		cellC := row.AddCell()
+		cellC.Value = item.SellerName
+		cellD := row.AddCell()
+		cellD.Value = item.CreateTime
+		cellE := row.AddCell()
+		cellE.Value = strconv.Itoa(item.StopTime)
+	}
+	err = xlsxFile.Save(downLoadnFilePath)
+	if err != nil {
+		br.Msg = "保存文件失败"
+		br.ErrMsg = "保存文件失败"
+		return
+	}
+	downloadFileName := time.Now().Format(utils.FormatDateTimeUnSpace) + ".xlsx"
+	this.Ctx.Output.Download(downLoadnFilePath, downloadFileName)
+	defer func() {
+		os.Remove(downLoadnFilePath)
+	}()
+	br.Ret = 200
+	br.Success = true
+	br.Msg = "导出成功"
+
+}

+ 49 - 28
models/cygx/cygx_yanxuan_special.go

@@ -2,6 +2,7 @@ package cygx
 
 import (
 	"github.com/beego/beego/v2/client/orm"
+	"github.com/rdlucklib/rdluck_tools/paging"
 	"time"
 )
 
@@ -22,31 +23,35 @@ type CygxYanxuanSpecial struct {
 }
 
 type CygxYanxuanSpeciaResplItem struct {
-	Id            int    `orm:"column(id);pk"`
-	UserId        int    // 用户ID
-	CreateTime    string // 创建时间
-	ModifyTime    string // 修改时间
-	PublishTime   string // 提审过审或驳回时间
-	Content       string // 内容
-	Tags          string // 标签
-	Status        int    // 1:未发布,2:审核中 3:已发布 4:驳回
-	ImgUrl        string // 图片链接
-	DocUrl        string // 文档链接
-	SpecialName   string // 专栏名称
-	Introduction  string // 介绍
-	Label         string // 标签
-	NickName      string // 昵称
-	RealName      string // 姓名
-	Mobile        string // 手机号
-	HeadImg       string // 头像
-	BgImg         string // 背景图
-	Reason        string // 理由
-	Title         string // 标题
-	CompanyTags   string
-	IndustryTags  string
-	Type          int // 类型1:笔记,2:观点
-	ContentHasImg int //正文是否包含图片 1包含 0不包含
-	Docs          []Doc
+	Id                int    `orm:"column(id);pk"`
+	UserId            int    // 用户ID
+	CreateTime        string // 创建时间
+	ModifyTime        string // 修改时间
+	PublishTime       string // 提审过审或驳回时间
+	Content           string // 内容
+	Tags              string // 标签
+	Status            int    // 1:未发布,2:审核中 3:已发布 4:驳回
+	ImgUrl            string // 图片链接
+	DocUrl            string // 文档链接
+	SpecialName       string // 专栏名称
+	Introduction      string // 介绍
+	Label             string // 标签
+	NickName          string // 昵称
+	RealName          string // 姓名
+	Mobile            string // 手机号
+	HeadImg           string // 头像
+	BgImg             string // 背景图
+	Reason            string // 理由
+	Title             string // 标题
+	CompanyTags       string
+	IndustryTags      string
+	Type              int // 类型1:笔记,2:观点
+	ContentHasImg     int //正文是否包含图片 1包含 0不包含
+	Docs              []Doc
+	Pv                string `description:"Pv"`
+	Uv                string `description:"Uv"`
+	ArticleCollectNum int    // 文章收藏数量
+	AdminName         string // 审核人员姓名
 }
 
 type Doc struct {
@@ -56,7 +61,23 @@ type Doc struct {
 	DocIcon   string
 }
 
-func GetYanxuanSpecialList(condition string, pars []interface{}) (items []*CygxYanxuanSpeciaResplItem, err error) {
+type GetCygxYanxuanSpeciaResplItemResp struct {
+	Paging *paging.PagingItem `description:"分页数据"`
+	List   []*CygxYanxuanSpeciaResplItem
+}
+
+// 获取数量
+func GetGetYanxuanSpecialCount(condition string, pars []interface{}) (count int, err error) {
+	o := orm.NewOrmUsingDB("hz_cygx")
+	sqlCount := ` SELECT COUNT(1) AS count  FROM cygx_yanxuan_special as a WHERE 1= 1  `
+	if condition != "" {
+		sqlCount += condition
+	}
+	err = o.Raw(sqlCount, pars).QueryRow(&count)
+	return
+}
+
+func GetYanxuanSpecialList(condition string, pars []interface{}, startSize, pageSize int) (items []*CygxYanxuanSpeciaResplItem, err error) {
 	o := orm.NewOrmUsingDB("hz_cygx")
 	sql := ``
 	sql = `SELECT a.*,b.bg_img,b.head_img,b.introduction,b.label,b.mobile,b.nick_name,b.real_name,b.special_name
@@ -66,8 +87,8 @@ JOIN cygx_yanxuan_special_author AS b ON a.user_id = b.user_id
 	if condition != "" {
 		sql += condition
 	}
-	sql += `ORDER BY a.publish_time `
-	_, err = o.Raw(sql, pars).QueryRows(&items)
+	sql += ` LIMIT ?,? `
+	_, err = o.Raw(sql, pars, startSize, pageSize).QueryRows(&items)
 	return
 }
 

+ 63 - 0
models/cygx/cygx_yanxuan_special_collect.go

@@ -0,0 +1,63 @@
+package cygx
+
+import (
+	"github.com/beego/beego/v2/client/orm"
+)
+
+type CygxYanxuanSpecialCollectResp struct {
+	CygxYanxuanSpecialCollectId int    `orm:"column(cygx_yanxuan_special_collect_id);pk"`
+	UserId                      int    // 用户ID
+	Mobile                      string // 手机号
+	Email                       string // 邮箱
+	CompanyId                   int    // 公司ID
+	CompanyName                 string // 公司名称
+	RealName                    string // 用户实际名称
+	SellerName                  string // 所属销售
+	CreateTime                  string // 创建时间
+	ModifyTime                  string // 修改时间
+	RegisterPlatform            int    // 来源 1小程序,2:网页
+	YanxuanSpecialId            int    // cygx_yanxuan_special 表主键ID
+}
+
+// 列表
+func GetCygxYanxuanSpecialCollectList(condition string, pars []interface{}, startSize, pageSize int) (items []*CygxYanxuanSpecialCollectResp, err error) {
+	o := orm.NewOrmUsingDB("hz_cygx")
+	sql := `SELECT * FROM cygx_yanxuan_special_collect as art WHERE 1= 1 `
+	if condition != "" {
+		sql += condition
+	}
+	sql += ` LIMIT ?,?  `
+	_, err = o.Raw(sql, pars, startSize, pageSize).QueryRows(&items)
+	return
+}
+
+type GetCygxYanxuanSpecialCollectResp struct {
+	List []*CygxYanxuanSpecialCollectResp
+}
+
+type CygxYanxuanSpecialRecordResp struct {
+	CygxYanxuanSpecialRecordId int    `orm:"column(cygx_yanxuan_special_record_id);pk"`
+	UserId                     int    // 用户ID
+	Mobile                     string // 手机号
+	Email                      string // 邮箱
+	CompanyId                  int    // 公司ID
+	CompanyName                string // 公司名称
+	RealName                   string // 用户实际名称
+	SellerName                 string // 所属销售
+	CreateTime                 string // 创建时间
+	ModifyTime                 string // 修改时间
+	RegisterPlatform           int    // 来源 1小程序,2:网页
+	YanxuanSpecialId           int    // cygx_yanxuan_special 表主键ID
+	StopTime                   int    // 停留时间
+}
+
+// 列表
+func GetCygxYanxuanSpecialRecordList(condition string, pars []interface{}) (items []*CygxYanxuanSpecialRecordResp, err error) {
+	o := orm.NewOrmUsingDB("hz_cygx")
+	sql := `SELECT * FROM cygx_yanxuan_special_record  as art WHERE 1= 1 `
+	if condition != "" {
+		sql += condition
+	}
+	_, err = o.Raw(sql, pars).QueryRows(&items)
+	return
+}

+ 46 - 21
models/cygx/cygx_yanxuan_special_user.go

@@ -2,6 +2,7 @@ package cygx
 
 import (
 	"github.com/beego/beego/v2/client/orm"
+	"github.com/rdlucklib/rdluck_tools/paging"
 	"time"
 )
 
@@ -26,20 +27,26 @@ type CygxYanxuanSpecialAuthor struct {
 }
 
 type CygxYanxuanSpecialAuthorItem struct {
-	Id           int    `orm:"column(id);pk"`
-	UserId       int    // 用户ID
-	CompanyName  string // 公司名
-	SpecialName  string // 专栏名称
-	Introduction string // 介绍
-	Label        string // 标签
-	NickName     string // 昵称
-	RealName     string // 姓名
-	Mobile       string // 手机号
-	CreateTime   string // 创建时间
-	ModifyTime   string // 修改时间
-	HeadImg      string // 头像
-	BgImg        string // 背景图
-	Status       int    // 1启用2禁用
+	Id                 int    `orm:"column(id);pk"`
+	UserId             int    // 用户ID
+	CompanyName        string // 公司名
+	SpecialName        string // 专栏名称
+	Introduction       string // 介绍
+	Label              string // 标签
+	NickName           string // 昵称
+	RealName           string // 姓名
+	Mobile             string // 手机号
+	CreateTime         string // 创建时间
+	ModifyTime         string // 修改时间
+	HeadImg            string // 头像
+	BgImg              string // 背景图
+	Status             int    // 1启用2禁用
+	Pv                 int    // Pv
+	Uv                 int    // Uv
+	ArticleNum         int    // 已发布的文章数量
+	ArticlePublishTime int    // 最近发布文章的时间
+	FansNum            int    // 粉丝数量
+	ArticleCollectNum  int    // 文章收藏数量
 }
 
 func AddCygxYanxuanSpecialAuthor(item *CygxYanxuanSpecialAuthor) (lastId int64, err error) {
@@ -68,14 +75,32 @@ func EnableYanxuanSpecialAuthor(userId, status int) (err error) {
 	return
 }
 
-func GetYanxuanSpecialAuthorList() (items []*CygxYanxuanSpecialAuthorItem, err error) {
+// 获取数量
+func GetYanxuanSpecialAuthorCount(condition string, pars []interface{}) (count int, err error) {
+	sqlCount := ` SELECT COUNT(1) AS count  FROM cygx_yanxuan_special_author as art WHERE 1= 1  `
+	if condition != "" {
+		sqlCount += condition
+	}
 	o := orm.NewOrmUsingDB("hz_cygx")
-	sql := ``
-	sql = `SELECT
-	a.*
-FROM
-	cygx_yanxuan_special_author as a ORDER BY create_time DESC `
-	_, err = o.Raw(sql).QueryRows(&items)
+	err = o.Raw(sqlCount, pars).QueryRow(&count)
+	return
+}
+
+type GetCygxYanxuanSpecialAuthorItemResp struct {
+	Paging *paging.PagingItem `description:"分页数据"`
+	List   []*CygxYanxuanSpecialAuthorItem
+}
+
+// 列表
+func GetYanxuanSpecialAuthorList(condition string, pars []interface{}, startSize, pageSize int) (items []*CygxYanxuanSpecialAuthorItem, err error) {
+	o := orm.NewOrmUsingDB("hz_cygx")
+	sql := `SELECT * FROM cygx_yanxuan_special_author as art WHERE 1= 1 `
+	if condition != "" {
+		sql += condition
+	}
+	//sql += ` LIMIT ?,?  `
+	_, err = o.Raw(sql, pars, startSize, pageSize).QueryRows(&items)
+	_, err = o.Raw(sql, pars).QueryRows(&items)
 	return
 }
 

+ 18 - 0
routers/commentsRouter.go

@@ -3058,6 +3058,24 @@ func init() {
             Filters: nil,
             Params: nil})
 
+    beego.GlobalControllerRouter["hongze/hz_crm_api/controllers/cygx:YanxuanSpecialController"] = append(beego.GlobalControllerRouter["hongze/hz_crm_api/controllers/cygx:YanxuanSpecialController"],
+        beego.ControllerComments{
+            Method: "ListPv",
+            Router: `/yanxuan_special/list_pv`,
+            AllowHTTPMethods: []string{"get"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["hongze/hz_crm_api/controllers/cygx:YanxuanSpecialController"] = append(beego.GlobalControllerRouter["hongze/hz_crm_api/controllers/cygx:YanxuanSpecialController"],
+        beego.ControllerComments{
+            Method: "SpecialCollectList",
+            Router: `/yanxuan_special/special_collect/list`,
+            AllowHTTPMethods: []string{"get"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
     beego.GlobalControllerRouter["hongze/hz_crm_api/controllers/data_manage/correlation:CorrelationChartClassifyController"] = append(beego.GlobalControllerRouter["hongze/hz_crm_api/controllers/data_manage/correlation:CorrelationChartClassifyController"],
         beego.ControllerComments{
             Method: "AddChartClassify",