| 123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- package plat
- import (
- "context"
- "dashoo.cn/opms_libary/myerrors"
- "github.com/gogf/gf/frame/g"
- "dashoo.cn/micro/app/dao/plat"
- model "dashoo.cn/micro/app/model/plat"
- "dashoo.cn/micro/app/service"
- )
- 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 = myerrors.DbError("获取总行数失败。")
- return
- }
- err = followupFileModel.Order("created_time ASC").Scan(&followupFileList)
- return
- }
|