|
@@ -22,7 +22,7 @@ func NewNoticePersonalDao(transactionContext *pgTransaction.TransactionContext) |
|
@@ -22,7 +22,7 @@ func NewNoticePersonalDao(transactionContext *pgTransaction.TransactionContext) |
|
22
|
}
|
22
|
}
|
|
23
|
|
23
|
|
|
24
|
//
|
24
|
//
|
|
25
|
-func (dao *NoticePersonalDao) ReadNoticePersonal(userId int64, noticeId int, readAll bool) (int, error) {
|
25
|
+func (dao *NoticePersonalDao) ReadNoticePersonal(userBaseId int64, noticeId int, readAll bool) (int, error) {
|
|
26
|
tx := dao.transactionContext.PgTx
|
26
|
tx := dao.transactionContext.PgTx
|
|
27
|
updateData := map[string]interface{}{
|
27
|
updateData := map[string]interface{}{
|
|
28
|
"is_read": domain.NoticePersonalIsRead,
|
28
|
"is_read": domain.NoticePersonalIsRead,
|
|
@@ -30,7 +30,7 @@ func (dao *NoticePersonalDao) ReadNoticePersonal(userId int64, noticeId int, rea |
|
@@ -30,7 +30,7 @@ func (dao *NoticePersonalDao) ReadNoticePersonal(userId int64, noticeId int, rea |
|
30
|
if readAll {
|
30
|
if readAll {
|
|
31
|
result, err := tx.Model(&updateData).
|
31
|
result, err := tx.Model(&updateData).
|
|
32
|
TableExpr("notice_personals").
|
32
|
TableExpr("notice_personals").
|
|
33
|
- Where("user_id=?", userId).
|
33
|
+ Where("user_base_id=?", userBaseId).
|
|
34
|
Where("is_read=?", domain.NoticePersonalIsNotRead).
|
34
|
Where("is_read=?", domain.NoticePersonalIsNotRead).
|
|
35
|
Update()
|
35
|
Update()
|
|
36
|
if err != nil {
|
36
|
if err != nil {
|
|
@@ -41,7 +41,6 @@ func (dao *NoticePersonalDao) ReadNoticePersonal(userId int64, noticeId int, rea |
|
@@ -41,7 +41,6 @@ func (dao *NoticePersonalDao) ReadNoticePersonal(userId int64, noticeId int, rea |
|
41
|
result, err := tx.Model(&updateData).
|
41
|
result, err := tx.Model(&updateData).
|
|
42
|
TableExpr("notice_personals").
|
42
|
TableExpr("notice_personals").
|
|
43
|
Where("notice_personal_id=?", noticeId).
|
43
|
Where("notice_personal_id=?", noticeId).
|
|
44
|
- Where("user_id=?", userId).
|
|
|
|
45
|
Update()
|
44
|
Update()
|
|
46
|
if err != nil {
|
45
|
if err != nil {
|
|
47
|
return 0, err
|
46
|
return 0, err
|