package plat import ( "context" "dashoo.cn/micro/app/dao/plat" model "dashoo.cn/micro/app/model/plat" "dashoo.cn/micro/app/service" "github.com/gogf/gf/errors/gerror" "github.com/gogf/gf/frame/g" ) type followupFileService struct { *service.ContextService Dao *plat.PlatFollowupFileDao } func NewFollowupFileService(ctx context.Context) (svc *followupFileService, err error) { svc = new(followupFileService) if svc.ContextService, err = svc.Init(ctx); err != nil { return nil, err } svc.Dao = plat.NewPlatFollowupFileDao(svc.Tenant) return svc, nil } // 跟进记录附件信息列表 func (s *followupFileService) GetList(req *model.SearchPlatFollowupFileReq) (total int, followupFileList []*model.PlatFollowupFile, err error) { followupFileModel := s.Dao.M if req.FollowId != "" { followupFileModel = followupFileModel.Where("follow_id", req.FollowId) } total, err = followupFileModel.Count() if err != nil { g.Log().Error(err) err = gerror.New("获取总行数失败") return } err = followupFileModel.Order("created_time ASC").Scan(&followupFileList) return }