update
parent
13d3e85317
commit
f579ad33e7
|
@ -44,8 +44,8 @@ func (e *Event) BeforeSave(tx *gorm.DB) (err error) {
|
||||||
(? >= "start" and ? <= "end" )
|
(? >= "start" and ? <= "end" )
|
||||||
or
|
or
|
||||||
(? >= "start" and ? <= "end" )
|
(? >= "start" and ? <= "end" )
|
||||||
and calendar_id = ? limit 1`,
|
and calendar_id = ? and id <> ? limit 1`,
|
||||||
e.End, e.End, e.Start, e.Start, e.CalendarID).Scan(&cnt)
|
e.End, e.End, e.Start, e.Start, e.CalendarID, e.ID).Scan(&cnt)
|
||||||
if cnt != "" {
|
if cnt != "" {
|
||||||
return errors.New(500, "event collide with existing")
|
return errors.New(500, "event collide with existing")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue