ver. 0.291: ShopProducer frontend migration to Domain + Controllers
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -301,6 +301,34 @@ class ProducerRepository
|
||||
return is_array($rows) ? array_map('intval', $rows) : [];
|
||||
}
|
||||
|
||||
/**
|
||||
* Aktywni producenci z pelnym danymi (frontend lista).
|
||||
*
|
||||
* @return array<int, array{id: int, name: string, img: string|null}>
|
||||
*/
|
||||
public function allActiveProducers(): array
|
||||
{
|
||||
$rows = $this->db->select('pp_shop_producer', ['id', 'name', 'img'], [
|
||||
'status' => 1,
|
||||
'ORDER' => ['name' => 'ASC'],
|
||||
]);
|
||||
|
||||
if (!is_array($rows)) {
|
||||
return [];
|
||||
}
|
||||
|
||||
$producers = [];
|
||||
foreach ($rows as $row) {
|
||||
$producers[] = [
|
||||
'id' => (int)($row['id'] ?? 0),
|
||||
'name' => (string)($row['name'] ?? ''),
|
||||
'img' => $row['img'] ?? null,
|
||||
];
|
||||
}
|
||||
|
||||
return $producers;
|
||||
}
|
||||
|
||||
private function defaultProducer(): array
|
||||
{
|
||||
return [
|
||||
|
||||
Reference in New Issue
Block a user