From c0efc3efce33cc2ebf7fee2661010efda383ab0c Mon Sep 17 00:00:00 2001 From: DanielVee Date: Tue, 24 Oct 2017 18:21:35 +1000 Subject: [PATCH] Update class-api.php Update static table name to $wpdb->prefix and defined table name. --- includes/class-api.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/class-api.php b/includes/class-api.php index 0211ad6..d7212aa 100644 --- a/includes/class-api.php +++ b/includes/class-api.php @@ -729,7 +729,7 @@ public function get_user_points( $user_id, $filters = array() ) { global $wpdb; - $query = 'SELECT SUM(CASE WHEN type = "points" THEN value ELSE 0 END) AS points FROM wp_broo_user_assignment WHERE user_id = ' + $query = 'SELECT SUM(CASE WHEN type = "points" THEN value ELSE 0 END) AS points FROM ' . $wpdb->prefix . BROO_USER_ASSIGNMENT_TABLE_NAME . ' WHERE user_id = ' . $user_id . ' AND ( NOW() <= expiry_dt OR expiry_dt IS NULL ) AND status = "approved"'; $added_to_query = true; @@ -1173,4 +1173,4 @@ public function add_user_action_meta( $user_action_id, $meta_key, $meta_value = array( '%s', '%s', '%s') ); } -} \ No newline at end of file +}