From 89ecdcd1bf625214a1cddf2c6b14e83ef292d26a Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Tue, 14 Nov 2017 11:46:24 -0500 Subject: [PATCH] Fix bad entry for reg_request_rate Fixing bug when adding the reg_reguest_rate entries. --- js/frontRegApp.js | 2 +- js/views/front/regClass.js | 2 +- models/admin/ajax/regFront/registrant.php | 6 ++++-- models/front/registrations/registration.php | 1 + 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/js/frontRegApp.js b/js/frontRegApp.js index 8a5226c..3084bf5 100644 --- a/js/frontRegApp.js +++ b/js/frontRegApp.js @@ -508,7 +508,7 @@ app.Views.Front.RegClass = Backbone.View.extend({ console.log( timeId ); // Check to see if the time is already in the collection // If it is then do nothing - console.log(this.model.regTimes); + console.log(this.model.regTimes.length); var findRegTime = this.model.regTimes.where({ id: timeId }); console.log(findRegTime.length); diff --git a/js/views/front/regClass.js b/js/views/front/regClass.js index be400db..dc9858e 100644 --- a/js/views/front/regClass.js +++ b/js/views/front/regClass.js @@ -39,7 +39,7 @@ app.Views.Front.RegClass = Backbone.View.extend({ console.log( timeId ); // Check to see if the time is already in the collection // If it is then do nothing - console.log(this.model.regTimes); + console.log(this.model.regTimes.length); var findRegTime = this.model.regTimes.where({ id: timeId }); console.log(findRegTime.length); diff --git a/models/admin/ajax/regFront/registrant.php b/models/admin/ajax/regFront/registrant.php index 6f6d75c..c53744c 100644 --- a/models/admin/ajax/regFront/registrant.php +++ b/models/admin/ajax/regFront/registrant.php @@ -250,10 +250,12 @@ class GlmMembersAdmin_registrations_ajax_registrant extends GlmDataRegistrations FROM " .GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . "reg_request_rate WHERE reg_event = %d AND rate = %d - AND reg_request = %d", + AND reg_request = %d + AND reg_request_class = %d", $modelData['reg_event'], $modelData['reg_rate'], - $modelData['reg_request'] + $modelData['reg_request'], + $regRequestClassId ) ); // At this point we need to get the rate data diff --git a/models/front/registrations/registration.php b/models/front/registrations/registration.php index 4e33ac4..c0958ba 100644 --- a/models/front/registrations/registration.php +++ b/models/front/registrations/registration.php @@ -197,6 +197,7 @@ foreach ( $regEvent['reg_class'] as $key => $rClass ) { // Pull the rate data if ( isset( $rClass['times'] ) && is_array( $rClass['times'] ) && count( $rClass['times'] ) > 0 ) { + // echo '
$rClass[times]: ' . print_r( $rClass['times'], true ) . '
'; foreach ( $rClass['times'] as &$time ) { $rClass['loggedIn'] = ( isset($_SESSION['LoginAccount']) ) ? true : false; $rClass['reg_rate_id'] = $time['id']; -- 2.17.1