作者 tangxvhui

调整短信通知

... ... @@ -159,6 +159,7 @@ func (notices *notifySms) sendSms(param *domain.LogSms) error {
err = sms.SendNoticeSms(param.Phone, param.TemplateId, param.Value)
if err != nil {
param.Result = err.Error()
param.Status = domain.SmsSuccess
} else {
param.Status = domain.SmsSuccess
}
... ...
... ... @@ -31,10 +31,17 @@ func (repo *LogSmsRepository) Save(param *domain.LogSms) error {
ExecuteAt: param.ExecuteAt,
}
tx := repo.transactionContext.PgTx
_, err := tx.Model(&m).Insert()
if m.Id == 0 {
_, err := tx.Model(&m).Insert()
if err != nil {
return err
}
}
_, err := tx.Model(&m).WherePK().Update()
if err != nil {
return err
}
return nil
}
... ...