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);