Ver código fonte

update

master
DengBiao 1 ano atrás
pai
commit
01a0953cef
1 arquivos alterados com 2 adições e 6 exclusões
  1. +2
    -6
      internal/logic/domain/message/repo/message_repo.go

+ 2
- 6
internal/logic/domain/message/repo/message_repo.go Ver arquivo

@@ -62,12 +62,8 @@ func (d *messageRepo) GetMessage(senderId, seq int64) (*model.Message, error) {

// GetMessageSeqForSendTime 获取消息状态
func (d *messageRepo) GetMessageSeqForSendTime(userId int64, sendTime time.Time) (int64, error) {
utils.FilePutContents("GetMessageSeqForSendTime", utils.SerializeStr(map[string]interface{}{
"userId": userId,
"sendTime": sendTime,
}))
var message model.Message
if err := db.DB.Where("user_id = ? and send_time = ?", userId, sendTime).
if err := db.DB.Table(d.tableName(userId)).Where("user_id = ? and send_time = ?", userId, sendTime).
First(&message).Error; err != nil {
return 0, gerrors.WrapError(err)
}
@@ -82,7 +78,7 @@ func (d *messageRepo) GetMessageSeqForSendTime(userId int64, sendTime time.Time)

// UpdateStatus 更新消息状态
func (d *messageRepo) UpdateStatus(userId int64, sendTime time.Time, status int) (int64, error) {
db := db.DB.Model(&model.Message{}).Where("user_id = ? and send_time = ?", userId, sendTime).
db := db.DB.Model(&model.Message{}).Table(d.tableName(userId)).Where("user_id = ? and send_time = ?", userId, sendTime).
Update("status", status)
if db.Error != nil {
return 0, gerrors.WrapError(db.Error)


Carregando…
Cancelar
Salvar