This commit is contained in:
2024-05-24 15:27:07 +03:00
parent 17df2ce6a9
commit fc1da2c238
643 changed files with 110185 additions and 231 deletions

View File

@ -3,6 +3,7 @@
namespace common\services;
use common\models\Company;
use common\models\ProductCategory;
use Yii;
use yii\helpers\ArrayHelper;
@ -61,4 +62,14 @@ class CompanyService
return ArrayHelper::map($this->getAddressesByUser($id), 'id', 'address');
}
/**
* @param int $id
* @return array
*/
public function getCategoryByCompanyId(int $id): array
{
return ProductCategory::find()->where(['company_id' => $id])->all();
}
}