From 54cfd3b2b13839ff896a3891ec8f5761a1354ab6 Mon Sep 17 00:00:00 2001 From: Paul Canning Date: Mon, 25 Jul 2016 16:08:02 +0100 Subject: [PATCH 1/2] Fixed PM default type for delete flag --- sql/Aauth_v2.sql | 4 ++-- sql/Aauth_v2_BCrypt.sql | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sql/Aauth_v2.sql b/sql/Aauth_v2.sql index 1efb8b6..360c646 100644 --- a/sql/Aauth_v2.sql +++ b/sql/Aauth_v2.sql @@ -77,8 +77,8 @@ CREATE TABLE `aauth_pms` ( `message` text, `date_sent` datetime DEFAULT NULL, `date_read` datetime DEFAULT NULL, - `pm_deleted_sender` int(1) DEFAULT '0', - `pm_deleted_receiver` int(1) DEFAULT '0', + `pm_deleted_sender` int(1) DEFAULT NULL, + `pm_deleted_receiver` int(1) DEFAULT NULL, PRIMARY KEY (`id`), KEY `full_index` (`id`,`sender_id`,`receiver_id`,`date_read`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; diff --git a/sql/Aauth_v2_BCrypt.sql b/sql/Aauth_v2_BCrypt.sql index 3af3c05..d47e5d2 100644 --- a/sql/Aauth_v2_BCrypt.sql +++ b/sql/Aauth_v2_BCrypt.sql @@ -77,8 +77,8 @@ CREATE TABLE `aauth_pms` ( `message` text, `date_sent` datetime DEFAULT NULL, `date_read` datetime DEFAULT NULL, - `pm_deleted_sender` int(1) DEFAULT '0', - `pm_deleted_receiver` int(1) DEFAULT '0', + `pm_deleted_sender` int(1) DEFAULT NULL, + `pm_deleted_receiver` int(1) DEFAULT NULL, PRIMARY KEY (`id`), KEY `full_index` (`id`,`sender_id`,`receiver_id`,`date_read`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; From e404e0a5c7b0caf3440c0183ca2f0a151cd565f7 Mon Sep 17 00:00:00 2001 From: Paul Canning Date: Mon, 25 Jul 2016 16:14:08 +0100 Subject: [PATCH 2/2] Fix for list_pms --- application/libraries/Aauth.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/libraries/Aauth.php b/application/libraries/Aauth.php index a18951a..0925307 100644 --- a/application/libraries/Aauth.php +++ b/application/libraries/Aauth.php @@ -1983,11 +1983,11 @@ class Aauth { public function list_pms($limit=5, $offset=0, $receiver_id=NULL, $sender_id=NULL){ if (is_numeric($receiver_id)){ $query = $this->aauth_db->where('receiver_id', $receiver_id); - $query = $this->aauth_db->where('pm_deleted_receiver', 0); + $query = $this->aauth_db->where('pm_deleted_receiver', NULL); } if (is_numeric($sender_id)){ $query = $this->aauth_db->where('sender_id', $sender_id); - $query = $this->aauth_db->where('pm_deleted_sender', 0); + $query = $this->aauth_db->where('pm_deleted_sender', NULL); } $query = $this->aauth_db->order_by('id','DESC');