diff --git a/application/Preorder/PreorderModel.php b/application/Preorder/PreorderModel.php index 9c10d4f24..f6de716af 100644 --- a/application/Preorder/PreorderModel.php +++ b/application/Preorder/PreorderModel.php @@ -300,6 +300,8 @@ class PreorderModel { $deleted = $filter['deleted']; if(is_numeric($deleted)) { $where .= " AND deleted=$deleted"; + } elseif($deleted == null) { + $where .= " (AND deleted IS NULL OR deleted = 0)" } } diff --git a/application/Preordernotification/Preordernotification.php b/application/Preordernotification/Preordernotification.php index 42e71cfa5..1d6a74e70 100644 --- a/application/Preordernotification/Preordernotification.php +++ b/application/Preordernotification/Preordernotification.php @@ -13,6 +13,7 @@ class Preordernotification extends mfBaseModel { $preorder_filter = json_decode($this->preorder_filter, true); $preorder_filter['preordercampaign_id'] = $this->preordercampaign_id; + $preorder_filter['deleted'] = null; $preorders = PreorderModel::search($preorder_filter); return $preorders; diff --git a/application/Preordernotification/PreordernotificationController.php b/application/Preordernotification/PreordernotificationController.php index e38a09952..bb67fdcbf 100644 --- a/application/Preordernotification/PreordernotificationController.php +++ b/application/Preordernotification/PreordernotificationController.php @@ -363,6 +363,7 @@ class PreordernotificationController extends mfBaseController { // get and save preorder count $preorder_filter = json_decode($notification->preorder_filter, true); $preorder_filter['preordercampaign_id'] = $notification->preordercampaign_id; + $preorder_filter['deleted'] = null; $preorder_count = PreorderModel::count($preorder_filter); $notification->recipient_count = $preorder_count; $notification->save();