diff --git a/Models/EmployeeMapper.php b/Models/EmployeeMapper.php index 22a92c9..f1358f9 100644 --- a/Models/EmployeeMapper.php +++ b/Models/EmployeeMapper.php @@ -64,7 +64,7 @@ final class EmployeeMapper extends DataMapperAbstract protected static array $hasMany = [ 'companyHistory' => [ 'mapper' => EmployeeHistoryMapper::class, - 'table' => 'hr_staff_history', + 'table' => 'hr_staff_history', // @todo: is this requried? This is stored in the mapper already. In other places I'm not using this, either use it everywhere or nowhere. Using the mapper is slower but protects us from table name changes! 'external' => 'hr_staff_history_staff', 'self' => null, ], @@ -98,8 +98,7 @@ final class EmployeeMapper extends DataMapperAbstract public static function getFromAccount(int $account) : Employee { $query = new Builder(self::$db); - $query->prefix(self::$db->getPrefix()) - ->select(self::$table . '.*') + $query->select(self::$table . '.*') ->from(self::$table) ->innerJoin(ProfileMapper::getTable()) ->on(self::$table . '.hr_staff_profile', '=', ProfileMapper::getTable() . '.' . ProfileMapper::getPrimaryField()) diff --git a/Models/StaffList.php b/Models/StaffList.php index 8ccdc29..304f7fc 100644 --- a/Models/StaffList.php +++ b/Models/StaffList.php @@ -68,10 +68,10 @@ class StaffList $search = $this->dbPool->get()->generate_sql_filter($filter, true); $sth = $this->dbPool->get()->con->prepare('SELECT - `' . $this->dbPool->get()->prefix . 'hr_staff`.* + `hr_staff`.* FROM - `' . $this->dbPool->get()->prefix . 'hr_staff` ' - . $search . 'LIMIT ' . $offset . ',' . $limit); + `hr_staff` ' + . $search . 'LIMIT ' . $offset . ',' . $limit); $sth->execute(); $result['list'] = $sth->fetchAll();