Browse Source

文章列表页面的开发

xiaoming_global 6 years ago
parent
commit
dc8c5387d9

+ 1 - 1
controllers/article/article_controller.go View File

74
 	adminUserInfo := this.GetAdminUserInfo()
74
 	adminUserInfo := this.GetAdminUserInfo()
75
 	userOrgID := adminUserInfo.CurrentOrgId
75
 	userOrgID := adminUserInfo.CurrentOrgId
76
 
76
 
77
-	articles, total, err := article_service.FindAllArticle(userOrgID, page,limit, searchKey, classId)
77
+	articles, total, err := article_service.FindAllArticle(userOrgID, page,10, searchKey, classId)
78
 	fmt.Println("文章内容是是么",articles)
78
 	fmt.Println("文章内容是是么",articles)
79
 	if err !=nil{
79
 	if err !=nil{
80
 		this.ServeFailJsonSend(enums.ErrorCodeDataException, "获取文章列表失败")
80
 		this.ServeFailJsonSend(enums.ErrorCodeDataException, "获取文章列表失败")

+ 1 - 1
service/article_service/article_category_service.go View File

16
 	return  err
16
 	return  err
17
 }
17
 }
18
 
18
 
19
-func FindAllArticle(orgID int64, page, limit, searchKey string, classId int64) (articles *[]models.Articles,total int64, err error) {
19
+func FindAllArticle(orgID int64, page int, count int, searchKey string, classId int64) (articles *[]models.Articles,total int64, err error) {
20
 
20
 
21
 	db := service.PatientReadDB().Table("sgj_patient_articles as a ").Where("a.status=1")
21
 	db := service.PatientReadDB().Table("sgj_patient_articles as a ").Where("a.status=1")
22
 	if(orgID>0){
22
 	if(orgID>0){