Commit b1c86307 authored by chenweijian's avatar chenweijian

im check

parent da1bfa2e
...@@ -209,9 +209,9 @@ func GetCpCancel(model *domain.Model, userIds []uint64, status cp_e.CpCancelStat ...@@ -209,9 +209,9 @@ func GetCpCancel(model *domain.Model, userIds []uint64, status cp_e.CpCancelStat
return res, nil return res, nil
} }
func GetCpCancelById(model *domain.Model, id uint64, status cp_e.CpCancelStatus) (*CpCancel, error) { func GetCpCancelById(model *domain.Model, id, userId uint64) (*CpCancel, error) {
res := new(CpCancel) res := new(CpCancel)
err := model.DB().Model(CpCancel{}).Where("status = ? and id = ?", status, id).First(&res).Error err := model.DB().Model(CpCancel{}).Where("id = ? and (user_id = ? or rec_user_id = ?)", id, userId, userId).First(&res).Error
if err != nil { if err != nil {
if err == gorm.ErrRecordNotFound { if err == gorm.ErrRecordNotFound {
return nil, nil return nil, nil
......
...@@ -502,7 +502,7 @@ func CheckCpImExpire(c *gin.Context) (*mycontext.MyContext, error) { ...@@ -502,7 +502,7 @@ func CheckCpImExpire(c *gin.Context) (*mycontext.MyContext, error) {
resId = common.MSG_ID_ALREADY_EXPIRED resId = common.MSG_ID_ALREADY_EXPIRED
} }
case 2: // 解除的消息im检查是否过期 case 2: // 解除的消息im检查是否过期
cpCancel, err := cp_m.GetCpCancelById(model, msgId, cp_e.CpCancel) cpCancel, err := cp_m.GetCpCancelById(model, msgId, userId)
if err != nil { if err != nil {
model.Log.Errorf("CheckCpImExpire userId:%d, msgType:%d, msgId:%d, err:%v", userId, msgType, msgId, err) model.Log.Errorf("CheckCpImExpire userId:%d, msgType:%d, msgId:%d, err:%v", userId, msgType, msgId, err)
return myCtx, err return myCtx, err
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment