|
@@ -1686,3 +1686,60 @@ func GetGrantPptList(adminId int, keyword, sourceType string) (ret models.RespGr
|
|
|
ret.Total = len(list)
|
|
|
return
|
|
|
}
|
|
|
+
|
|
|
+// GetPptList 公共ppt和我的ppt
|
|
|
+// @Author roc
|
|
|
+// @Time 2022-08-29 16:27:59
|
|
|
+func GetPptList(adminId int, keyword string) (ret models.RespGroupPptList, err error) {
|
|
|
+ list := make([]*models.RespGroupPptListItem, 0)
|
|
|
+ ret.List = list
|
|
|
+
|
|
|
+ var condition string
|
|
|
+ var pars []interface{}
|
|
|
+
|
|
|
+ condition += ` AND (admin_id=? OR is_share=1) `
|
|
|
+ pars = append(pars, adminId)
|
|
|
+
|
|
|
+ if keyword != `` {
|
|
|
+ condition += ` AND (title LIKE ? ) `
|
|
|
+ pars = append(pars, "%"+keyword+"%")
|
|
|
+ }
|
|
|
+ pptList, err := models.GetAllPptV2List(condition, pars)
|
|
|
+
|
|
|
+ if len(pptList) <= 0 {
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ for _, v := range pptList {
|
|
|
+ tmpV := &models.RespGroupPptListItem{
|
|
|
+ GroupPptId: int64(v.PptId),
|
|
|
+ PptId: int64(v.PptId),
|
|
|
+ TemplateType: v.TemplateType,
|
|
|
+ BackgroundImg: v.BackgroundImg,
|
|
|
+ Title: v.Title,
|
|
|
+ PptCreateTime: v.CreateTime.Format(utils.FormatDateTime),
|
|
|
+ AdminId: v.AdminId,
|
|
|
+ AdminRealName: v.AdminRealName,
|
|
|
+ PptVersion: v.PptVersion,
|
|
|
+ IsSingleShare: v.IsShare,
|
|
|
+ PptxUrl: v.PptxUrl,
|
|
|
+ ReportId: v.ReportId,
|
|
|
+ ReportCode: v.ReportCode,
|
|
|
+ }
|
|
|
+ list = append(list, tmpV)
|
|
|
+ }
|
|
|
+ if keyword != `` {
|
|
|
+ for _, v := range list {
|
|
|
+ if strings.Contains(v.Title, keyword) {
|
|
|
+ index := strings.Index(v.Title,keyword)
|
|
|
+ newTitle := v.Title[:index] + "<span class=\"color-light\">"+ keyword +"</span>"+ v.Title[index+len(keyword):]
|
|
|
+ v.Title = newTitle
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ ret.List = list
|
|
|
+ ret.Total = len(list)
|
|
|
+ return
|
|
|
+}
|