$query = parent::
getDetailQuery($id);
$query->
addSelect(['PARTIAL article.{id, name}'
]);
$query->
addSelect('shop'
);
$query->
leftJoin('vote.article', 'article'
);
$query->
leftJoin('vote.shop', 'shop'
);
return $query;
} protected function getSearchAssociationQuery($association,
$model,
$search) { $query = parent::
getSearchAssociationQuery($association,
$model,
$search);
if ($association == 'article'
) { $query->
innerJoin('article.votes', 'votes'
);
$query->
groupBy('article.id'
);
} return $query;
} /**
* @param array{success: true, data: array<array<string, mixed>>, total: int} $list
* @param array<int, array<string, mixed>> $shops indexed by id
*
* @return array{success: true, data: array<array<string, mixed>>, total: int}
*/