作者 tangxuhui

更新

1 -{"D:\\workspaceGo\\src\\allied-creation-basic\\pkg\\port\\beego":1629512512589801900}  
  1 +{"D:\\workspaceGo\\src\\allied-creation-basic\\pkg\\port\\beego":1629526811710336200}
@@ -93,6 +93,9 @@ func (noticeSettingService *NoticeSettingService) ListNoticeSetting(listNoticeSe @@ -93,6 +93,9 @@ func (noticeSettingService *NoticeSettingService) ListNoticeSetting(listNoticeSe
93 if err := transactionContext.CommitTransaction(); err != nil { 93 if err := transactionContext.CommitTransaction(); err != nil {
94 return 0, nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) 94 return 0, nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
95 } 95 }
  96 + if len(noticeSettings) == 0 {
  97 + noticeSettings = []*domain.NoticeSetting{}
  98 + }
96 return count, 99 return count,
97 noticeSettings, 100 noticeSettings,
98 nil 101 nil
@@ -152,11 +152,11 @@ func (repository *NoticePersonalRepository) Find(queryOptions map[string]interfa @@ -152,11 +152,11 @@ func (repository *NoticePersonalRepository) Find(queryOptions map[string]interfa
152 query := sqlbuilder.BuildQuery(tx.Model(&noticePersonalModels), queryOptions) 152 query := sqlbuilder.BuildQuery(tx.Model(&noticePersonalModels), queryOptions)
153 query.SetOffsetAndLimit(20) 153 query.SetOffsetAndLimit(20)
154 query.SetOrderDirect("notice_personal_id", "DESC") 154 query.SetOrderDirect("notice_personal_id", "DESC")
155 - query.SetWhereByQueryOption("notice_personal.user_id", "userId")  
156 - query.SetWhereByQueryOption("notice_personal.org_id", "orgId")  
157 - query.SetWhereByQueryOption("notice_personal.company_id", "companyId")  
158 - query.SetWhereByQueryOption("notice_personal.is_read", "isRead")  
159 - query.SetWhereByQueryOption("notice_personal.user_base_id", "userBaseId") 155 + query.SetWhereByQueryOption("notice_personal.user_id=?", "userId")
  156 + query.SetWhereByQueryOption("notice_personal.org_id=?", "orgId")
  157 + query.SetWhereByQueryOption("notice_personal.company_id=?", "companyId")
  158 + query.SetWhereByQueryOption("notice_personal.is_read=?", "isRead")
  159 + query.SetWhereByQueryOption("notice_personal.user_base_id=?", "userBaseId")
160 if count, err := query.SelectAndCount(); err != nil { 160 if count, err := query.SelectAndCount(); err != nil {
161 return 0, noticePersonals, err 161 return 0, noticePersonals, err
162 } else { 162 } else {