wangfei 6 lat temu
rodzic
commit
194853a160
2 zmienionych plików z 10 dodań i 0 usunięć
  1. 1
    0
      models/course/course.go
  2. 9
    0
      service/message/location.go

+ 1
- 0
models/course/course.go Wyświetl plik

@@ -580,6 +580,7 @@ type CourseWithCase struct {
580 580
 	model.TaCourse `xorm:"extends"`
581 581
 	CaseName       string
582 582
 	CaseAddress    string
583
+	CourseTags     []TagDetail
583 584
 }
584 585
 
585 586
 // GetSelectCourseWithCaseList 获取精选课程

+ 9
- 0
service/message/location.go Wyświetl plik

@@ -125,6 +125,15 @@ func (s *MessageServ) GetLocationInfoList() ([]message.LocationInfo, error) {
125 125
 			}
126 126
 			locations[inx].Courses = courses
127 127
 		}
128
+
129
+		for ci, cc := range locations[inx].Courses {
130
+			tags, err := s.coursedao.GetCourseTag(cc.CourseId)
131
+			if err != nil {
132
+				utils.LogError("获取课程标签信息失败: " + err.Error())
133
+				return nil, errors.New("获取课程标签信息失败")
134
+			}
135
+			locations[inx].Courses[ci].CourseTags = tags
136
+		}
128 137
 	}
129 138
 
130 139
 	return locations, nil