...
|
...
|
@@ -22,7 +22,7 @@ func NewNoticePersonalDao(transactionContext *pgTransaction.TransactionContext) |
|
|
}
|
|
|
|
|
|
//
|
|
|
func (dao *NoticePersonalDao) ReadNoticePersonal(userId int64, noticeId int, readAll bool) (int, error) {
|
|
|
func (dao *NoticePersonalDao) ReadNoticePersonal(userBaseId int64, noticeId int, readAll bool) (int, error) {
|
|
|
tx := dao.transactionContext.PgTx
|
|
|
updateData := map[string]interface{}{
|
|
|
"is_read": domain.NoticePersonalIsRead,
|
...
|
...
|
@@ -30,7 +30,7 @@ func (dao *NoticePersonalDao) ReadNoticePersonal(userId int64, noticeId int, rea |
|
|
if readAll {
|
|
|
result, err := tx.Model(&updateData).
|
|
|
TableExpr("notice_personals").
|
|
|
Where("user_id=?", userId).
|
|
|
Where("user_base_id=?", userBaseId).
|
|
|
Where("is_read=?", domain.NoticePersonalIsNotRead).
|
|
|
Update()
|
|
|
if err != nil {
|
...
|
...
|
@@ -41,7 +41,6 @@ func (dao *NoticePersonalDao) ReadNoticePersonal(userId int64, noticeId int, rea |
|
|
result, err := tx.Model(&updateData).
|
|
|
TableExpr("notice_personals").
|
|
|
Where("notice_personal_id=?", noticeId).
|
|
|
Where("user_id=?", userId).
|
|
|
Update()
|
|
|
if err != nil {
|
|
|
return 0, err
|
...
|
...
|
|