Fixed Showing Orders of users of same company

This commit is contained in:
Frank Schubert
2022-04-27 16:40:47 +02:00
parent 864aa03acc
commit d7192b0378
11 changed files with 422 additions and 52 deletions

View File

@@ -70,7 +70,23 @@ class Address extends mfBaseModel {
return $this->getFullName();
}
public function getUserIds($childs = true) {
$userIds = [];
foreach(UserModel::search(['address_id' => $this->id]) as $user) {
$userIds[] = $user->id;
}
if($childs) {
foreach(AddressModel::search(['parent_id' => $this->id]) as $child) {
foreach(UserModel::search(['address_id' => $child->id]) as $user) {
$userIds[] = $user->id;
}
}
}
$userIds = array_unique($userIds);
return $userIds;
}
public function loadAddresstypes() {
if(!$this->id) {