正在显示
4 个修改的文件
包含
9 行增加
和
5 行删除
| @@ -71,9 +71,9 @@ type ( | @@ -71,9 +71,9 @@ type ( | ||
| 71 | Id int64 `json:"id"` | 71 | Id int64 `json:"id"` |
| 72 | CompanyId int64 `json:"companyId,omitempty"` // 公司ID | 72 | CompanyId int64 `json:"companyId,omitempty"` // 公司ID |
| 73 | CompanyName string `json:"companyName,omitempty"` // 公司名称 | 73 | CompanyName string `json:"companyName,omitempty"` // 公司名称 |
| 74 | - Name string `json:"name,omitempty"` // 名称 | ||
| 75 | - Avatar string `json:"avatar,omitempty"` // 头像 | ||
| 76 | - Position string `json:"position,omitempty"` // 职位 | 74 | + Name string `json:"name"` // 名称 |
| 75 | + Avatar string `json:"avatar"` // 头像 | ||
| 76 | + Position string `json:"position"` // 职位 | ||
| 77 | } | 77 | } |
| 78 | 78 | ||
| 79 | 79 |
| @@ -51,6 +51,8 @@ func (l *MiniArticleMarkUserReadLogic) MiniArticleMarkUserRead(req *types.MiniAr | @@ -51,6 +51,8 @@ func (l *MiniArticleMarkUserReadLogic) MiniArticleMarkUserRead(req *types.MiniAr | ||
| 51 | return nil, xerr.NewErrMsgErr("标记浏览记录失败", err) | 51 | return nil, xerr.NewErrMsgErr("标记浏览记录失败", err) |
| 52 | } | 52 | } |
| 53 | if len(markRecord) > 0 { | 53 | if len(markRecord) > 0 { |
| 54 | + markRecord[0].Author = articleData.Author | ||
| 55 | + markRecord[0].Title = articleData.Title | ||
| 54 | _, err = l.svcCtx.UserReadArticleRepository.Update(l.ctx, conn, markRecord[0]) | 56 | _, err = l.svcCtx.UserReadArticleRepository.Update(l.ctx, conn, markRecord[0]) |
| 55 | if err != nil { | 57 | if err != nil { |
| 56 | return nil, xerr.NewErrMsgErr("标记浏览记录失败", err) | 58 | return nil, xerr.NewErrMsgErr("标记浏览记录失败", err) |
| @@ -296,7 +296,7 @@ type SimpleUser struct { | @@ -296,7 +296,7 @@ type SimpleUser struct { | ||
| 296 | Id int64 `json:"id"` | 296 | Id int64 `json:"id"` |
| 297 | CompanyId int64 `json:"companyId,omitempty"` // 公司ID | 297 | CompanyId int64 `json:"companyId,omitempty"` // 公司ID |
| 298 | CompanyName string `json:"companyName,omitempty"` // 公司名称 | 298 | CompanyName string `json:"companyName,omitempty"` // 公司名称 |
| 299 | - Name string `json:"name,omitempty"` // 名称 | 299 | + Name string `json:"name"` // 名称 |
| 300 | Avatar string `json:"avatar,omitempty"` // 头像 | 300 | Avatar string `json:"avatar,omitempty"` // 头像 |
| 301 | Position string `json:"position,omitempty"` // 职位 | 301 | Position string `json:"position,omitempty"` // 职位 |
| 302 | } | 302 | } |
| @@ -136,7 +136,9 @@ func (repository *ArticleRepository) Find(ctx context.Context, conn transaction. | @@ -136,7 +136,9 @@ func (repository *ArticleRepository) Find(ctx context.Context, conn transaction. | ||
| 136 | if v, ok := queryOptions["endCreatedAt"]; ok { | 136 | if v, ok := queryOptions["endCreatedAt"]; ok { |
| 137 | tx = tx.Where("created_at < ?", v) | 137 | tx = tx.Where("created_at < ?", v) |
| 138 | } | 138 | } |
| 139 | - | 139 | + if v, ok := queryOptions["authorId"]; ok { |
| 140 | + tx = tx.Where("author_id=?", v) | ||
| 141 | + } | ||
| 140 | if total, tx = transaction.PaginationAndCount(ctx, tx, queryOptions, &ms); tx.Error != nil { | 142 | if total, tx = transaction.PaginationAndCount(ctx, tx, queryOptions, &ms); tx.Error != nil { |
| 141 | return dms, tx.Error | 143 | return dms, tx.Error |
| 142 | } | 144 | } |
-
请 注册 或 登录 后发表评论