|
@@ -43,6 +43,8 @@ type CygxYanxuanSpecialItem struct {
|
|
|
Reason string // 理由
|
|
|
Title string // 标题
|
|
|
Type string // 类型1:笔记,2:观点
|
|
|
+ CollectNum int
|
|
|
+ IsCollect int
|
|
|
}
|
|
|
|
|
|
func GetYanxuanSpecialList(condition string, pars []interface{}) (items []*CygxYanxuanSpecialItem, err error) {
|
|
@@ -115,31 +117,30 @@ func UpdateYanxuanSpecial(item *CygxYanxuanSpecial) (err error) {
|
|
|
sql := ``
|
|
|
sql = `UPDATE cygx_yanxuan_special SET title=?,content=?,tags=?,img_url=?,doc_url=?,type=?,status=?,
|
|
|
modify_time=NOW(),publish_time=NOW() WHERE id = ? `
|
|
|
- _, err = o.Raw(sql, item.Title, item.Content,item.Tags,item.ImgUrl,item.DocUrl,item.Type,item.Status).Exec()
|
|
|
+ _, err = o.Raw(sql, item.Title, item.Content, item.Tags, item.ImgUrl, item.DocUrl, item.Type, item.Status, item.Id).Exec()
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
func GetYanxuanSpecialIndustry(keyword string) (IndustryNames []string, err error) {
|
|
|
o := orm.NewOrm()
|
|
|
sql := ``
|
|
|
- if keyword == ""{
|
|
|
+ if keyword == "" {
|
|
|
sql = `SELECT industry_name FROM cygx_yanxuan_special_industry `
|
|
|
} else {
|
|
|
- sql = `SELECT industry_name FROM cygx_yanxuan_special_industry WHERE industry_name LIKE '%`+keyword+`%' `
|
|
|
+ sql = `SELECT industry_name FROM cygx_yanxuan_special_industry WHERE industry_name LIKE '%` + keyword + `%' `
|
|
|
}
|
|
|
_, err = o.Raw(sql).QueryRows(&IndustryNames)
|
|
|
return
|
|
|
}
|
|
|
|
|
|
type CancelPublishCygxYanxuanSpecialReq struct {
|
|
|
- Id int // 文章id
|
|
|
+ Id int // 文章id
|
|
|
}
|
|
|
+
|
|
|
func CancelPublishYanxuanSpecial(id int) (err error) {
|
|
|
o := orm.NewOrm()
|
|
|
sql := ``
|
|
|
sql = `UPDATE cygx_yanxuan_special SET status=1,publish_time=NOW() WHERE id = ? `
|
|
|
_, err = o.Raw(sql, id).Exec()
|
|
|
return
|
|
|
-}
|
|
|
+}
|