Skip to content

Commit

Permalink
Add table prefixes for deleted_at fields
Browse files Browse the repository at this point in the history
  • Loading branch information
MGatner authored Jun 12, 2019
1 parent ad20714 commit ee0f8fe
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions system/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

//--------------------------------------------------------------------
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit ee0f8fe

Please sign in to comment.