正在显示
2 个修改的文件
包含
8 行增加
和
0 行删除
| @@ -159,6 +159,7 @@ func (notices *notifySms) sendSms(param *domain.LogSms) error { | @@ -159,6 +159,7 @@ func (notices *notifySms) sendSms(param *domain.LogSms) error { | ||
| 159 | err = sms.SendNoticeSms(param.Phone, param.TemplateId, param.Value) | 159 | err = sms.SendNoticeSms(param.Phone, param.TemplateId, param.Value) |
| 160 | if err != nil { | 160 | if err != nil { |
| 161 | param.Result = err.Error() | 161 | param.Result = err.Error() |
| 162 | + param.Status = domain.SmsSuccess | ||
| 162 | } else { | 163 | } else { |
| 163 | param.Status = domain.SmsSuccess | 164 | param.Status = domain.SmsSuccess |
| 164 | } | 165 | } |
| @@ -31,10 +31,17 @@ func (repo *LogSmsRepository) Save(param *domain.LogSms) error { | @@ -31,10 +31,17 @@ func (repo *LogSmsRepository) Save(param *domain.LogSms) error { | ||
| 31 | ExecuteAt: param.ExecuteAt, | 31 | ExecuteAt: param.ExecuteAt, |
| 32 | } | 32 | } |
| 33 | tx := repo.transactionContext.PgTx | 33 | tx := repo.transactionContext.PgTx |
| 34 | + if m.Id == 0 { | ||
| 34 | _, err := tx.Model(&m).Insert() | 35 | _, err := tx.Model(&m).Insert() |
| 35 | if err != nil { | 36 | if err != nil { |
| 36 | return err | 37 | return err |
| 37 | } | 38 | } |
| 39 | + } | ||
| 40 | + _, err := tx.Model(&m).WherePK().Update() | ||
| 41 | + if err != nil { | ||
| 42 | + return err | ||
| 43 | + } | ||
| 44 | + | ||
| 38 | return nil | 45 | return nil |
| 39 | } | 46 | } |
| 40 | 47 |
-
请 注册 或 登录 后发表评论