update
parent
f579ad33e7
commit
7ce8e6577a
|
@ -41,9 +41,11 @@ func (e *Event) BeforeSave(tx *gorm.DB) (err error) {
|
||||||
// test for collide
|
// test for collide
|
||||||
cnt := ""
|
cnt := ""
|
||||||
db.Raw(`select id from events e where
|
db.Raw(`select id from events e where
|
||||||
|
(
|
||||||
(? >= "start" and ? <= "end" )
|
(? >= "start" and ? <= "end" )
|
||||||
or
|
or
|
||||||
(? >= "start" and ? <= "end" )
|
(? >= "start" and ? <= "end" )
|
||||||
|
)
|
||||||
and calendar_id = ? and id <> ? limit 1`,
|
and calendar_id = ? and id <> ? limit 1`,
|
||||||
e.End, e.End, e.Start, e.Start, e.CalendarID, e.ID).Scan(&cnt)
|
e.End, e.End, e.Start, e.Start, e.CalendarID, e.ID).Scan(&cnt)
|
||||||
if cnt != "" {
|
if cnt != "" {
|
||||||
|
|
Loading…
Reference in New Issue