From: Laury GvR Date: Sat, 27 Jul 2019 00:02:57 +0000 (-0400) Subject: Coupons and packages only get entries active today X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/index.cgi?a=commitdiff_plain;h=4b2a8d5602dff3177003a66c5cf5524cfdef1e5b;p=WP-Plugins%2Fglm-member-db-rest-api.git Coupons and packages only get entries active today --- diff --git a/setup/routes/dashboard.php b/setup/routes/dashboard.php index f9877fa..e2b782a 100644 --- a/setup/routes/dashboard.php +++ b/setup/routes/dashboard.php @@ -250,7 +250,9 @@ class GLMA_Dashboard_Rest_Controller public function get_coupons_summary() { $fields = "id, name, name_slug, descr, image, start_date, end_date, expire"; $table = GLM_MEMBERS_COUPONS_PLUGIN_DB_PREFIX."coupons"; - $where = "status IN (".$this->config['status_numb']['Active'].")"; + $where = "status IN (".$this->config['status_numb']['Active'].") + AND start_date <= CURDATE() + AND end_date >= CURDATE()"; $sql = " SELECT $fields FROM $table @@ -265,7 +267,9 @@ class GLMA_Dashboard_Rest_Controller public function get_packages_summary() { $fields = "id, title, package_slug, short_descr, image, start_date, end_date, expire_date"; $table = GLM_MEMBERS_PACKAGING_PLUGIN_DB_PREFIX."packages"; - $where = "status IN (".$this->config['status_numb']['Active'].")"; + $where = "status IN (".$this->config['status_numb']['Active'].") + AND start_date <= CURDATE() + AND end_date >= CURDATE()"; $sql = " SELECT $fields FROM $table