$messages = ORM::factory('Message')
->where('eventID', '=', $eventID)
->and_where_open()
->or_where('initiatorID', '=', $userID)
->or_where('targetTypeID', '=', $userTypeID)
->and_where_close()
->order_by('Time', 'asc')
->find_all();
这句的意思是:
where eventID=$eventID and (initiatorID=$userID or targetTypeID=$userTypeID)