public function getCategoriesValues()
{
$query = $this->getQuery(['applyCategory_id']);
$query->select(['{{%categories}}.id', '{{%categories}}.parent_id', '{{%categories}}.title']);
$query->leftJoin('{{%categories}}', '{{%products}}.category_id = {{%categories}}.id');
$query->groupBy('{{%categories}}.title');
$query->orderBy('{{%categories}}.title');
return $query->all();
}
$query->select(['main_categories.title', 'sub_categories.title']);