Commit e3398126 authored by hujiebin's avatar hujiebin

Update noble.go

parent 090a6c4f
......@@ -44,7 +44,11 @@ func SendNoble(model *domain.Model, receiverUserId mysql.ID, level uint16, days
n = noble_m.UserNoble{UserId: receiverUserId, Level: level, EndTime: endTime}
err = n.Create(model.DB())
if err != nil {
if af2, err := n.ExtenedEndTime(model.DB(), int(days)); err != nil {
return err
} else if af2 <= 0 {
return fmt.Errorf("bizerr.TransactionFailed create rows 0")
}
}
nbl := noble_m.UserNobleLog{
......@@ -57,11 +61,7 @@ func SendNoble(model *domain.Model, receiverUserId mysql.ID, level uint16, days
}
err = nbl.Create(model.DB())
if err != nil {
if af2, err := n.ExtenedEndTime(model.DB(), int(days)); err != nil {
return err
} else if af2 <= 0 {
return fmt.Errorf("bizerr.TransactionFailed create rows 0")
}
}
} else {
// 延长贵族
......
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