From: Steve Sutton Date: Tue, 26 Jan 2016 21:06:56 +0000 (-0500) Subject: Update how to get member list for coupon edit page X-Git-Tag: v0.1.1^2 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=acf6c3d985d21c997e89ec822afb16d84a87ede3;p=WP-Plugins%2Fglm-coupons.git Update how to get member list for coupon edit page Also update how it is getting the member info record that is active when it needs it for printing the coupons. --- diff --git a/controllers/front.php b/controllers/front.php index 9db5425..3519b1f 100644 --- a/controllers/front.php +++ b/controllers/front.php @@ -151,7 +151,8 @@ class glm_coupon_front SELECT m.member_name, addr1,c.name as city,state,zip FROM " . GLM_MEMBERS_PLUGIN_DB_PREFIX . "member_info m LEFT OUTER JOIN " . GLM_MEMBERS_PLUGIN_DB_PREFIX . "cities c ON (c.id = m.city) - WHERE m.id = {$id}"; + WHERE m.member = {$id} + AND m.status = 10"; $results = $wpdb->get_results($sql, ARRAY_A); if ($results[0]) { $address = array(); diff --git a/index.php b/index.php index 0a49362..8072f19 100644 --- a/index.php +++ b/index.php @@ -2,7 +2,7 @@ /** * Plugin Name: Gaslight Media Coupons * Description: Coupon Application for Gaslight Media Clients. - * Version: 0.1.0 Beta + * Version: 0.1.1 Beta * Author: Steve Sutton * Author URI: http://www.gaslightmedia.com * License: All right reserved diff --git a/models/coupon.php b/models/coupon.php index a3708aa..092eeb2 100644 --- a/models/coupon.php +++ b/models/coupon.php @@ -234,10 +234,9 @@ class glm_coupons_coupon return false; } else { $sql = " - SELECT id,member_name as name - FROM " . GLM_MEMBERS_PLUGIN_DB_PREFIX . "member_info - WHERE status = 10 - ORDER BY member_name"; + SELECT id,name + FROM " . GLM_MEMBERS_PLUGIN_DB_PREFIX . "members + ORDER BY name"; $results = $wpdb->get_results($sql, ARRAY_A); foreach ($results as $row) { $members[] = $row;