article.go 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576
  1. package services
  2. import (
  3. "errors"
  4. "fmt"
  5. "github.com/PuerkitoBio/goquery"
  6. "hongze/hongze_mfyx/models"
  7. "hongze/hongze_mfyx/utils"
  8. "html"
  9. "regexp"
  10. "sort"
  11. "strconv"
  12. "strings"
  13. )
  14. func GetReportContentTextSub(content string) (contentSub string, err error) {
  15. content = html.UnescapeString(content)
  16. doc, err := goquery.NewDocumentFromReader(strings.NewReader(content))
  17. docText := doc.Text()
  18. bodyRune := []rune(docText)
  19. bodyRuneLen := len(bodyRune)
  20. if bodyRuneLen > 200 {
  21. bodyRuneLen = 200
  22. }
  23. body := string(bodyRune[:bodyRuneLen])
  24. contentSub = body
  25. contentSub = strings.Replace(body, "Powered by Froala Editor", "", -1)
  26. return
  27. }
  28. func GetReportContentTextSubNew(content string) (contentSub string, err error) {
  29. content = html.UnescapeString(content)
  30. doc, errdoc := goquery.NewDocumentFromReader(strings.NewReader(content))
  31. if errdoc != nil {
  32. err = errdoc
  33. return
  34. }
  35. docText := doc.Text()
  36. bodyRune := []rune(docText)
  37. bodyRuneLen := len(bodyRune)
  38. body := string(bodyRune[:bodyRuneLen])
  39. contentSub = body
  40. contentSub = strings.Replace(contentSub, "Powered by Froala Editor", "", -1)
  41. contentSub = strings.Replace(contentSub, " ", "", -1)
  42. contentSub = strings.Replace(contentSub, "<p data-f-id=\"pbf\" style=\"text-align: center; font-size: 14px; margin-top: 30px; opacity: 0.65; font-family: sanered by <a href=\"https://www.froala.com/wysiwyg-editor?pb=1\" title=\"Froala Editor\">Froala Editor</a></p>", "", -1)
  43. return
  44. }
  45. func FixArticleImgUrl(body string) (contentSub string, err error) {
  46. r := strings.NewReader(string(body))
  47. doc, err := goquery.NewDocumentFromReader(r)
  48. if err != nil {
  49. fmt.Println(err)
  50. }
  51. doc.Find("img").Each(func(i int, s *goquery.Selection) {
  52. src, _ := s.Attr("src")
  53. if i == 0 && src != "" {
  54. contentSub = src
  55. }
  56. })
  57. return
  58. }
  59. // UserViewRedisData 阅读数据
  60. type UserViewRedisData struct {
  61. Mobile string `json:"mobile"`
  62. Email string `json:"email"`
  63. RealName string `json:"real_name"`
  64. CompanyName string `json:"company_name"`
  65. ViewTime string `json:"view_time" description:"阅读时间,格式:2022-02-17 13:06:13"`
  66. ProductId int `json:"product_id" description:"报告所属产品,ficc:1,权益:2"`
  67. CompanyId int `json:"company_id" description:"客户id"`
  68. UserId int `json:"user_id" description:"用户id"`
  69. ReportId int `json:"report_id" description:"报告id"`
  70. StopTime int `json:"stop_time" description:"停留时间"`
  71. ReportChapterId int `json:"report_chapter_id" description:"章节ID"`
  72. OutId int `json:"out_id" description:"记录ID"`
  73. }
  74. type ReportViewRecord struct {
  75. Id int `orm:"column(id);pk"`
  76. //UserId int `json:"user_id" description:"用户ID"`
  77. //ReportId int `description:"报告id"`
  78. //Mobile string `description:"手机号"`
  79. //Email string `description:"邮箱"`
  80. //RealName string `description:"用户实际姓名"`
  81. //CompanyName string `description:"公司名称"`
  82. //CreateTime time.Time `description:"创建时间"`
  83. //StopTime int `json:"stop_time" description:"停留时间"`
  84. //ReportChapterId int `json:"report_chapter_id" description:"章节ID"`
  85. //OutId int `json:"out_id" description:"记录ID"`
  86. Mobile string `json:"mobile"`
  87. Email string `json:"email"`
  88. RealName string `json:"real_name"`
  89. CompanyName string `json:"company_name"`
  90. ViewTime string `json:"view_time" description:"阅读时间,格式:2022-02-17 13:06:13"`
  91. ProductId int `json:"product_id" description:"报告所属产品,ficc:1,权益:2"`
  92. CompanyId int `json:"company_id" description:"客户id"`
  93. UserId int `json:"user_id" description:"用户id"`
  94. ReportId int `json:"report_id" description:"报告id"`
  95. StopTime int `json:"stop_time" description:"停留时间"`
  96. ReportChapterId int `json:"report_chapter_id" description:"章节ID"`
  97. OutId int `json:"out_id" description:"章节ID"`
  98. }
  99. // PushViewRecordNewRedisData 阅读数据加入到redis
  100. func PushViewRecordNewRedisData(reportViewRecord *ReportViewRecord, companyId int) bool {
  101. data := &UserViewRedisData{
  102. Mobile: reportViewRecord.Mobile,
  103. UserId: reportViewRecord.UserId,
  104. Email: reportViewRecord.Email,
  105. RealName: reportViewRecord.RealName,
  106. CompanyName: reportViewRecord.CompanyName,
  107. ViewTime: reportViewRecord.ViewTime,
  108. ProductId: 2,
  109. CompanyId: companyId,
  110. ReportId: reportViewRecord.ReportId,
  111. StopTime: reportViewRecord.StopTime,
  112. ReportChapterId: reportViewRecord.ReportChapterId,
  113. OutId: reportViewRecord.OutId,
  114. }
  115. if utils.Re == nil {
  116. err := utils.Rc.LPush(utils.CACHE_KEY_USER_VIEW, data)
  117. if err != nil {
  118. fmt.Println("PushViewRecordNewRedisData LPush Err:" + err.Error())
  119. }
  120. return true
  121. }
  122. return false
  123. }
  124. // GetSpecialArticleDetailUserPower 处理用户查看专项调研文章详情的权限
  125. func GetSpecialArticleDetailUserPower(user *models.WxUserItem, articleInfo *models.ArticleDetail) (havePower bool, err error) {
  126. userType, _, e := GetUserType(user.CompanyId)
  127. if e != nil {
  128. err = errors.New("GetSpecialUserType, Err: " + e.Error())
  129. return
  130. }
  131. // 永续客户、大套餐客户可以查看行业升级套餐客户 权限
  132. if userType == 1 || userType == 2 {
  133. havePower = true
  134. return
  135. }
  136. permissionStr, e := GetCompanyPermissionUpgrade(user.CompanyId)
  137. if e != nil {
  138. err = errors.New("GetCompanyPermissionUpgrade, Err: " + e.Error())
  139. return
  140. }
  141. reportMapDetail, e := models.GetdetailByCategoryIdPush(articleInfo.CategoryId)
  142. if e != nil {
  143. err = errors.New("GetdetailByCategoryIdPush, Err: " + e.Error())
  144. return
  145. }
  146. if reportMapDetail == nil {
  147. err = errors.New("GetdetailByCategoryIdP,获取详情失败, ")
  148. return
  149. }
  150. fmt.Println(permissionStr)
  151. //如果没有对应的升级权限,则返回
  152. if !strings.Contains(permissionStr, reportMapDetail.ChartPermissionName) {
  153. return
  154. } else {
  155. havePower = true
  156. }
  157. return
  158. }
  159. // HandleArticleCategoryImg 预处理文章的封面图片
  160. func HandleArticleCategoryImg(list []*models.HomeArticle) (items []*models.HomeArticle, err error) {
  161. //研选的五张图片
  162. detailResearch, e := models.GetConfigByCode("category_research_img_url")
  163. if e != nil {
  164. err = errors.New("获取研选的五张图片失败" + e.Error())
  165. return
  166. }
  167. researchList := strings.Split(detailResearch.ConfigValue, "{|}")
  168. //对应分类的所图片
  169. detailCategoryUrl, err := models.GetConfigByCode("category_map_img_url")
  170. if err != nil {
  171. err = errors.New("获取对应分类的所图片失败" + err.Error())
  172. return
  173. }
  174. categoryUrlList := strings.Split(detailCategoryUrl.ConfigValue, "{|}")
  175. mapCategoryUrl := make(map[string]string)
  176. var categoryId string
  177. var imgUrlChart string
  178. for _, v := range categoryUrlList {
  179. vslice := strings.Split(v, "_")
  180. categoryId = vslice[0]
  181. imgUrlChart = vslice[len(vslice)-1]
  182. mapCategoryUrl[categoryId] = imgUrlChart
  183. }
  184. mapChartPerssion := make(map[string]string)
  185. reportMappingList, err := models.GetReportMappingStrategyAll()
  186. if err != nil {
  187. err = errors.New("GetReportMappingStrategyAll err" + err.Error())
  188. return
  189. }
  190. for _, v := range reportMappingList {
  191. mapChartPerssion[strconv.Itoa(v.CategoryId)] = v.ChartPermissionName
  192. }
  193. for k, v := range list {
  194. list[k].Abstract, _ = GetReportContentTextSub(v.Abstract)
  195. item := list[k]
  196. //如果文章一开始的内容是图片,优先展示第一张图片
  197. if list[k].Annotation == "" {
  198. imgurl, _ := FixArticleImgUrl(html.UnescapeString(list[k].Body))
  199. if imgurl != "" {
  200. list[k].BodyHtml = imgurl
  201. }
  202. }
  203. //newBody, _ := GetReportContentTextSubByarticle(item.Body, item.Annotation, item.ArticleId)
  204. list[k].Annotation = ArticleAnnotation(item)
  205. list[k].Body = ""
  206. list[k].PublishDate = utils.StrTimeToTime(item.PublishDate).Format(utils.FormatDate) //时间字符串格式转时间格式
  207. if item.Pv > 999 {
  208. list[k].Pv = 999
  209. }
  210. list[k].ChartPermissionName = mapChartPerssion[v.CategoryId]
  211. //如果是研选系列的任意取五张图片的中的一张
  212. if v.CategoryId == "0" || v.ArticleId > utils.SummaryArticleId {
  213. knum := v.ArticleId % 5
  214. list[k].ImgUrlPc = researchList[knum]
  215. } else {
  216. list[k].ImgUrlPc = mapCategoryUrl[v.CategoryId]
  217. }
  218. list[k].ArticleResponse = 4 // 默认展示核心观点
  219. //ArticleResponse int `description:"报告类型 0:啥也不是,1研选报告,2:研选纪要,3:研选沙龙,4;核心观点"`
  220. if list[k].ArticleId >= utils.SummaryArticleId {
  221. list[k].HttpUrl = utils.StrategyPlatform + strconv.Itoa(v.ArticleId)
  222. list[k].IsNeedJump = true
  223. list[k].ArticleResponse = 1
  224. //if v.IsReport == 1 {
  225. // list[k].ArticleResponse = 1
  226. //} else if v.ArticleTypeName == "纪要" {
  227. // list[k].ArticleResponse = 2
  228. //} else if v.ArticleTypeName == "观点" {
  229. // list[k].ArticleResponse = 3
  230. //} else if v.ArticleTypeName == "沙龙" {
  231. // list[k].ArticleResponse = 3
  232. //} else if v.ArticleTypeName == "路演精华" {
  233. // list[k].ArticleResponse = 1
  234. //}
  235. }
  236. list[k].Source = 1
  237. //添加行业默认图片
  238. if v.ImgUrlPc == "" {
  239. if v.ChartPermissionName == utils.YI_YAO_NAME {
  240. list[k].ImgUrlPc = utils.YI_YAO_OTHER_IMG
  241. } else if v.ChartPermissionName == utils.XIAO_FEI_NAME {
  242. list[k].ImgUrlPc = utils.XIAO_FEI_OTHER_IMG
  243. } else if v.ChartPermissionName == utils.KE_JI_NAME {
  244. list[k].ImgUrlPc = utils.KE_JI_OTHER_IMG
  245. } else if v.ChartPermissionName == utils.ZHI_ZAO_NAME {
  246. list[k].ImgUrlPc = utils.ZHI_ZAO_OTHER_IMG
  247. }
  248. }
  249. //是不是研选报告
  250. if v.ArticleTypeId > 0 {
  251. list[k].IsResearch = true
  252. if v.ArticleTypeId == 12 {
  253. list[k].LabelKeyword = "研选沙龙"
  254. list[k].LabelKeywordImgLink = utils.LABEL_ICO_6
  255. } else {
  256. list[k].LabelKeyword = "纪要"
  257. list[k].LabelKeywordImgLink = utils.LABEL_ICO_5
  258. }
  259. }
  260. }
  261. articleIds := make([]int, 0)
  262. for i := range list {
  263. articleIds = append(articleIds, list[i].ArticleId)
  264. }
  265. // 报告关联产业信息
  266. industryMap := make(map[int][]*models.IndustrialManagementIdInt, 0)
  267. if len(articleIds) > 0 {
  268. var industryCond string
  269. var industryPars []interface{}
  270. industryCond += ` AND mg.article_id IN (` + utils.GetOrmInReplace(len(articleIds)) + `)`
  271. industryPars = append(industryPars, articleIds)
  272. industryList, e := models.GetIndustrialListByarticleId(industryPars, industryCond)
  273. if e != nil {
  274. err = errors.New("GetIndustrialListByarticleId" + e.Error())
  275. return
  276. }
  277. for i := range industryList {
  278. v := industryList[i]
  279. industryMap[v.ArticleId] = append(industryMap[v.ArticleId], &models.IndustrialManagementIdInt{
  280. ArticleId: v.ArticleId,
  281. IndustrialManagementId: v.IndustrialManagementId,
  282. IndustryName: v.IndustryName,
  283. ChartPermissionId: v.ChartPermissionId,
  284. })
  285. }
  286. }
  287. for k, v := range list {
  288. if len(industryMap[v.ArticleId]) > 0 {
  289. list[k].List = industryMap[v.ArticleId]
  290. } else {
  291. list[k].List = make([]*models.IndustrialManagementIdInt, 0)
  292. }
  293. }
  294. if len(list) == 0 {
  295. list = make([]*models.HomeArticle, 0)
  296. }
  297. items = list
  298. return
  299. }
  300. // 处理核心观点的展示规则
  301. func ArticleAnnotation(item *models.HomeArticle) (annotation string) {
  302. if item.ArticleId >= utils.SummaryArticleId {
  303. item.Annotation = YxArticleAnnotation(item)
  304. }
  305. if item.Annotation != "" {
  306. annotation = strings.Replace(item.Annotation, "<br>", "", -1)
  307. annotation = strings.Replace(item.Annotation, "&nbsp;", "", -1)
  308. } else {
  309. return
  310. }
  311. bodyText, _ := GetReportContentTextSubNew(annotation)
  312. if bodyText == "" {
  313. return
  314. }
  315. if annotation != "" {
  316. annotation = html.UnescapeString(annotation)
  317. doc, _ := goquery.NewDocumentFromReader(strings.NewReader(annotation))
  318. docText := doc.Text()
  319. mapDoc := make(map[int]string)
  320. var mapSort []int
  321. p := doc.Find("p")
  322. p.Each(func(tk int, pd *goquery.Selection) {
  323. pdText := pd.Text()
  324. pdText = strings.Replace(pdText, " ", "", -1)
  325. if pdText != "" {
  326. textLen := strings.Index(docText, pdText)
  327. mapDoc[(strings.Index(docText, pdText))] = pdText
  328. mapSort = append(mapSort, textLen)
  329. }
  330. })
  331. li := doc.Find("li")
  332. li.Each(func(tk int, li *goquery.Selection) {
  333. liText := li.Text()
  334. liText = strings.Replace(liText, " ", "", -1)
  335. if liText != "" {
  336. textLen := strings.Index(docText, liText)
  337. mapDoc[(strings.Index(docText, liText))] = strconv.Itoa(tk+1) + "." + liText
  338. mapSort = append(mapSort, textLen)
  339. }
  340. })
  341. ul := doc.Find("ul")
  342. ul.Each(func(tk int, ul *goquery.Selection) {
  343. ulText := ul.Text()
  344. ulText = strings.Replace(ulText, " ", "", -1)
  345. if ulText != "" {
  346. textLen := strings.Index(docText, ulText)
  347. mapDoc[(strings.Index(docText, ulText))] = ulText
  348. mapSort = append(mapSort, textLen)
  349. }
  350. })
  351. if len(mapSort) == 0 {
  352. return
  353. } else {
  354. //排序
  355. sort.Ints(mapSort)
  356. var annotationHtml string
  357. for _, vSort := range mapSort {
  358. for k, v := range mapDoc {
  359. if k == vSort && v != "" {
  360. annotationHtml += v + "<br>"
  361. }
  362. }
  363. }
  364. annotationHtml = strings.TrimRight(annotationHtml, "<br>")
  365. annotationHtml = "<p>" + annotationHtml + "</p>"
  366. annotation = annotationHtml
  367. }
  368. }
  369. return
  370. }
  371. // 处理核心观点的展示规则
  372. func AnnotationHtml(bodyText string) (annotation string) {
  373. if bodyText == "" {
  374. return
  375. }
  376. annotation = bodyText
  377. annotation = html.UnescapeString(annotation)
  378. doc, _ := goquery.NewDocumentFromReader(strings.NewReader(annotation))
  379. docText := doc.Text()
  380. mapDoc := make(map[int]string)
  381. var mapSort []int
  382. p := doc.Find("p")
  383. p.Each(func(tk int, pd *goquery.Selection) {
  384. pdText := pd.Text()
  385. pdText = strings.Replace(pdText, " ", "", -1)
  386. if pdText != "" {
  387. textLen := strings.Index(docText, pdText)
  388. mapDoc[(strings.Index(docText, pdText))] = pdText
  389. mapSort = append(mapSort, textLen)
  390. }
  391. })
  392. li := doc.Find("li")
  393. li.Each(func(tk int, li *goquery.Selection) {
  394. liText := li.Text()
  395. liText = strings.Replace(liText, " ", "", -1)
  396. if liText != "" {
  397. textLen := strings.Index(docText, liText)
  398. mapDoc[(strings.Index(docText, liText))] = strconv.Itoa(tk+1) + "." + liText
  399. mapSort = append(mapSort, textLen)
  400. }
  401. })
  402. ul := doc.Find("ul")
  403. ul.Each(func(tk int, ul *goquery.Selection) {
  404. ulText := ul.Text()
  405. ulText = strings.Replace(ulText, " ", "", -1)
  406. if ulText != "" {
  407. textLen := strings.Index(docText, ulText)
  408. mapDoc[(strings.Index(docText, ulText))] = ulText
  409. mapSort = append(mapSort, textLen)
  410. }
  411. })
  412. section := doc.Find("section")
  413. section.Each(func(tk int, section *goquery.Selection) {
  414. sectionText := section.Text()
  415. sectionText = strings.Replace(sectionText, " ", "", -1)
  416. if sectionText != "" {
  417. textLen := strings.Index(docText, sectionText)
  418. mapDoc[(strings.Index(docText, sectionText))] = sectionText
  419. mapSort = append(mapSort, textLen)
  420. }
  421. })
  422. if len(mapSort) == 0 {
  423. return
  424. } else {
  425. //排序
  426. sort.Ints(mapSort)
  427. var annotationHtml string
  428. for _, vSort := range mapSort {
  429. for k, v := range mapDoc {
  430. if k == vSort && v != "" {
  431. annotationHtml += v + "<br>"
  432. }
  433. }
  434. }
  435. annotationHtml = strings.TrimRight(annotationHtml, "<br>")
  436. annotationHtml = "<p>" + annotationHtml + "</p>"
  437. annotation = annotationHtml
  438. }
  439. return
  440. }
  441. // 处理产品内测展示规则
  442. func ProductInteriorHtml(bodyText string) (annotation string) {
  443. if bodyText == "" {
  444. return
  445. }
  446. sliceBody := strings.Split(bodyText, "</p>")
  447. annotation, _ = GetReportContentTextSub(sliceBody[0])
  448. return
  449. }
  450. // 解析研选内容中的核心观点
  451. func YxArticleAnnotation(article *models.HomeArticle) (annotation string) {
  452. //如果不规范,就获取内容主体
  453. if strings.Count(article.Body, "<hr") == 0 {
  454. //如果内容不规范而且,还有图片,就把核心观点置空
  455. if article.BodyHtml != "" {
  456. return
  457. }
  458. annotation, _ = GetReportContentTextSub(article.Body)
  459. return
  460. }
  461. body := strings.ReplaceAll(article.Body, "<strong>", "")
  462. body = strings.ReplaceAll(body, "</strong>", "")
  463. body = strings.ReplaceAll(body, "</ol>", "</div>")
  464. body = strings.ReplaceAll(body, "<ol>", "<div>")
  465. body = strings.ReplaceAll(body, "</li>", "</p>")
  466. body = strings.ReplaceAll(body, "<li>", "<p>")
  467. re, _ := regexp.Compile("<strong.*?>")
  468. body = re.ReplaceAllString(body, "")
  469. reLi, _ := regexp.Compile("<li.*?>")
  470. body = reLi.ReplaceAllString(body, "")
  471. var plus int
  472. coreIndex := strings.Index(body, "核心观点:")
  473. plus = 15
  474. if coreIndex == -1 {
  475. coreIndex = strings.Index(body, "核心观点:")
  476. plus = 13
  477. }
  478. if coreIndex == -1 {
  479. coreIndex = strings.Index(body, "核心观点")
  480. plus = 12
  481. }
  482. if coreIndex == -1 {
  483. coreIndex = strings.Index(body, "核心结论:")
  484. plus = 15
  485. }
  486. if coreIndex == -1 {
  487. coreIndex = strings.Index(body, "核心结论:")
  488. plus = 13
  489. }
  490. if coreIndex == -1 {
  491. coreIndex = strings.Index(body, "核心结论")
  492. plus = 12
  493. }
  494. endIndex := strings.Index(body, "<hr")
  495. if coreIndex != -1 && endIndex != -1 {
  496. body = body[coreIndex+plus : endIndex]
  497. }
  498. annotation = body
  499. return
  500. }
  501. // GetYxArticleIdMap 获取研选文章ID
  502. func GetYxArticleIdMap(articleIds []int) (mapResp map[int]bool) {
  503. var err error
  504. defer func() {
  505. if err != nil {
  506. go utils.SendAlarmMsg("获取研选文章ID失败,GetYxArticleIdMap"+err.Error(), 2)
  507. }
  508. }()
  509. var condition string
  510. var pars []interface{}
  511. condition = ` AND article_type_id > 0 `
  512. if len(articleIds) > 0 {
  513. condition += ` AND article_id IN (` + utils.GetOrmInReplace(len(articleIds)) + `)`
  514. pars = append(pars, articleIds)
  515. }
  516. articleList, e := models.GetArticleList(condition, pars)
  517. if e != nil {
  518. err = errors.New("GetArticleList, Err: " + e.Error())
  519. return
  520. }
  521. mapResp = make(map[int]bool, 0)
  522. for _, v := range articleList {
  523. mapResp[v.ArticleId] = true
  524. }
  525. return
  526. }
  527. // GetYanxuanArticleIds 获取研选文章ID
  528. func GetYanxuanArticleIds() (articleIds []int) {
  529. var err error
  530. defer func() {
  531. if err != nil {
  532. fmt.Println(err)
  533. go utils.SendAlarmMsg("获取研选文章ID GetYanxuanArticleIds,失败:"+err.Error(), 2)
  534. }
  535. }()
  536. var condition string
  537. var pars []interface{}
  538. condition = ` AND article_type_id > 0 `
  539. list, e := models.GetCygxCygxArticleIdList(condition, pars)
  540. if e != nil {
  541. err = errors.New("GetCygxCygxArticleIdList, Err: " + e.Error())
  542. return
  543. }
  544. for _, v := range list {
  545. articleIds = append(articleIds, v.ArticleId)
  546. }
  547. return
  548. }