From ee0f8feff1e30dbc2adf881de872b1f75de2829a Mon Sep 17 00:00:00 2001 From: MGatner Date: Wed, 12 Jun 2019 10:01:16 -0400 Subject: [PATCH] Add table prefixes for `deleted_at` fields --- system/Model.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/system/Model.php b/system/Model.php index 4a560c7992ea..821c512ecb79 100644 --- a/system/Model.php +++ b/system/Model.php @@ -947,8 +947,8 @@ public function purgeDeleted() } return $this->builder() - ->where($this->deletedField . ' IS NOT NULL') - ->delete(); + ->where($this->table . '.' . $this->deletedField . ' IS NOT NULL') + ->delete(); } //-------------------------------------------------------------------- @@ -981,7 +981,7 @@ public function onlyDeleted() $this->tempUseSoftDeletes = false; $this->builder() - ->where($this->deletedField . ' IS NOT NULL'); + ->where($this->table . '.' . $this->deletedField . ' IS NOT NULL'); return $this; } @@ -1543,7 +1543,7 @@ public function countAllResults(bool $reset = true, bool $test = false) { if ($this->tempUseSoftDeletes === true) { - $this->builder()->where($this->deletedField, null); + $this->builder()->where($this->table . '.' . $this->deletedField, null); } return $this->builder()->countAllResults($reset, $test);