@@ -182,6 +182,7 @@ public function GetCourseList( $attributes, $category_id, $city, $subjectid, $co
182182 ' and StartDate le ' . edu_get_timezoned_date ( 'c ' , 'now 23:59:59 + ' . $ fetch_months . ' months ' ) .
183183 ' and EndDate ge ' . edu_get_timezoned_date ( 'c ' , 'now ' ) .
184184 ' and OnDemand eq false ' .
185+ ( ! empty ( $ city ) ? ' and LocationId eq ' . intval ( $ city ) : '' ) .
185186 '; ' .
186187 '$expand=PriceNames($filter=PublicPriceName;$select=PriceNameId,PriceNameDescription,Price,MaxParticipantNumber,NumberOfParticipants,DiscountPercent;) ' .
187188 '; ' .
@@ -223,11 +224,7 @@ public function GetCourseList( $attributes, $category_id, $city, $subjectid, $co
223224 $ orderby = explode ( ' ' , $ custom_order_by );
224225 $ sortorder = explode ( ' ' , $ custom_order_by_order );
225226 foreach ( $ orderby as $ od => $ v ) {
226- if ( isset ( $ sortorder [ $ od ] ) ) {
227- $ or = $ sortorder [ $ od ];
228- } else {
229- $ or = 'asc ' ;
230- }
227+ $ or = isset ( $ sortorder [ $ od ] ) ? $ sortorder [ $ od ] : 'asc ' ;
231228
232229 if ( edu_validate_column ( 'course ' , $ v ) !== false ) {
233230 $ sorting [] = $ v . ' ' . strtolower ( $ or );
@@ -300,6 +297,7 @@ public function GetOnDemandCourseList( $attributes, $category_id, $city, $subjec
300297 ' and CompanySpecific eq false ' .
301298 ' and OnDemand eq true ' .
302299 ' and OnDemandPublished eq true ' .
300+ ( ! empty ( $ city ) ? ' and LocationId eq ' . intval ( $ city ) : '' ) .
303301 '; ' .
304302 '$expand=PriceNames($filter=PublicPriceName;$select=PriceNameId,PriceNameDescription,Price,MaxParticipantNumber,NumberOfParticipants,DiscountPercent;) ' .
305303 '; ' .
@@ -341,11 +339,7 @@ public function GetOnDemandCourseList( $attributes, $category_id, $city, $subjec
341339 $ orderby = explode ( ' ' , $ custom_order_by );
342340 $ sortorder = explode ( ' ' , $ custom_order_by_order );
343341 foreach ( $ orderby as $ od => $ v ) {
344- if ( isset ( $ sortorder [ $ od ] ) ) {
345- $ or = $ sortorder [ $ od ];
346- } else {
347- $ or = 'asc ' ;
348- }
342+ $ or = isset ( $ sortorder [ $ od ] ) ? $ sortorder [ $ od ] : 'asc ' ;
349343
350344 if ( edu_validate_column ( 'course ' , $ v ) !== false ) {
351345 $ sorting [] = $ v . ' ' . strtolower ( $ or );
@@ -417,6 +411,7 @@ public function GetEventList( $attributes, $category_id, $city, $subjectid, $cou
417411 ' and StartDate le ' . edu_get_timezoned_date ( 'c ' , 'now 23:59:59 + ' . $ fetch_months . ' months ' ) .
418412 ' and EndDate ge ' . edu_get_timezoned_date ( 'c ' , 'now ' ) .
419413 ' and OnDemand eq false ' .
414+ ( ! empty ( $ city ) ? ' and LocationId eq ' . intval ( $ city ) : '' ) .
420415 '; ' .
421416 '$expand=PriceNames($filter=PublicPriceName;$select=PriceNameId,PriceNameDescription,Price,MaxParticipantNumber,NumberOfParticipants,DiscountPercent;),EventDates($orderby=StartDate;$select=StartDate,EndDate;) ' .
422417 '; ' .
@@ -530,6 +525,7 @@ public function GetOnDemandEventList( $attributes, $category_id, $city, $subject
530525 ' and CompanySpecific eq false ' .
531526 ' and OnDemand eq true ' .
532527 ' and OnDemandPublished eq true ' .
528+ ( ! empty ( $ city ) ? ' and LocationId eq ' . intval ( $ city ) : '' ) .
533529 '; ' .
534530 '$expand=PriceNames($filter=PublicPriceName;$select=PriceNameId,PriceNameDescription,Price,MaxParticipantNumber,NumberOfParticipants,DiscountPercent;),EventDates($orderby=StartDate;$select=StartDate,EndDate;) ' .
535531 '; ' .
0 commit comments