@@ -107,6 +107,8 @@ public function getVideos($params = [])
107107 break ;
108108
109109 case 'search ' :
110+ $ search = trim ($ criteria );
111+
110112 $ videos = $ videos
111113 ->innerJoin ('Presentation ' , 'Presentation.ID = PresentationMaterial.PresentationID ' )
112114 ->innerJoin ('SummitEvent ' , 'SummitEvent.ID = Presentation.ID ' )
@@ -115,19 +117,17 @@ public function getVideos($params = [])
115117 'Presentation_Speakers.PresentationID = Presentation.ID ' )
116118 ->innerJoin ('PresentationSpeaker ' ,
117119 'PresentationSpeaker.ID = Presentation_Speakers.PresentationSpeakerID ' )
118- ->leftJoin ('PresentationCategory ' , 'PresentationCategory.ID = SummitEvent.CategoryID ' );
119-
120- $ search = trim ($ criteria );
121-
122- $ videos ->where ("
120+ ->leftJoin ('PresentationCategory ' , 'PresentationCategory.ID = SummitEvent.CategoryID ' )
121+ ->where ("
123122 CONCAT(PresentationSpeaker.FirstName,' ',PresentationSpeaker.LastName) = ' $ search'
124123 OR PresentationSpeaker.FirstName LIKE '% $ search%'
125124 OR PresentationSpeaker.LastName LIKE '% $ search%'
126- OR Presentation .Title LIKE '% $ search%'
125+ OR SummitEvent .Title LIKE '% $ search%'
127126 OR PresentationCategory.Title = '% $ search%'
128127 OR Summit.Title LIKE '% $ search%' " )
129- ->limit ($ defaultLimit )
130- ->sort ('DateUploaded DESC ' );
128+ ->limit ($ defaultLimit );
129+
130+ //die($videos->sql());
131131
132132 $ match_videos = GroupedList::create ($ videos )->groupBy ('YouTubeID ' );
133133
0 commit comments