mirror of
https://github.com/Karaka-Management/oms-HumanResourceManagement.git
synced 2026-02-13 11:28:41 +00:00
fix dbmapper bugs
This commit is contained in:
parent
8cb09f146f
commit
22811bdecf
|
|
@ -97,11 +97,11 @@ final class EmployeeMapper extends DataMapperAbstract
|
||||||
*/
|
*/
|
||||||
public static function getFromAccount(int $account) : Employee
|
public static function getFromAccount(int $account) : Employee
|
||||||
{
|
{
|
||||||
|
$depth = 3;
|
||||||
$query = new Builder(self::$db);
|
$query = new Builder(self::$db);
|
||||||
$query->select(self::$table . '.*')
|
$query = self::getQuery($query)
|
||||||
->from(self::$table)
|
|
||||||
->innerJoin(ProfileMapper::getTable())
|
->innerJoin(ProfileMapper::getTable())
|
||||||
->on(self::$table . '.hr_staff_profile', '=', ProfileMapper::getTable() . '.' . ProfileMapper::getPrimaryField())
|
->on(self::$table . '_' . $depth . '.hr_staff_profile', '=', ProfileMapper::getTable() . '.' . ProfileMapper::getPrimaryField())
|
||||||
->innerJoin(AccountMapper::getTable())
|
->innerJoin(AccountMapper::getTable())
|
||||||
->on(ProfileMapper::getTable() . '.profile_account_account', '=', AccountMapper::getTable() . '.' . AccountMapper::getPrimaryField())
|
->on(ProfileMapper::getTable() . '.profile_account_account', '=', AccountMapper::getTable() . '.' . AccountMapper::getPrimaryField())
|
||||||
->where(AccountMapper::getTable() . '.' . AccountMapper::getPrimaryField(), '=', $account)
|
->where(AccountMapper::getTable() . '.' . AccountMapper::getPrimaryField(), '=', $account)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user