From: Steve Sutton Date: Tue, 14 Nov 2017 16:46:24 +0000 (-0500) Subject: Fix bad entry for reg_request_rate X-Git-Tag: v1.0.0^2~277 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=89ecdcd1bf625214a1cddf2c6b14e83ef292d26a;p=WP-Plugins%2Fglm-member-db-registrations.git Fix bad entry for reg_request_rate Fixing bug when adding the reg_reguest_rate entries. --- 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'];