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