1: | <?php
|
2: | namespace Opencart\Catalog\Model\Localisation;
|
3: | |
4: | |
5: | |
6: | |
7: |
|
8: | class GeoZone extends \Opencart\System\Engine\Model {
|
9: | |
10: | |
11: | |
12: | |
13: | |
14: | |
15: | |
16: | |
17: |
|
18: | public function getGeoZone(int $geo_zone_id, int $country_id, int $zone_id): array {
|
19: | $query = $this->db->query("SELECT * FROM `" . DB_PREFIX . "zone_to_geo_zone` WHERE `geo_zone_id` = '" . (int)$geo_zone_id . "' AND `country_id` = '" . (int)$country_id . "' AND (`zone_id` = '" . (int)$zone_id . "' OR `zone_id` = '0')");
|
20: |
|
21: | return $query->row;
|
22: | }
|
23: |
|
24: | |
25: | |
26: | |
27: | |
28: |
|
29: | public function getGeoZones(): array {
|
30: | $query = $this->db->query("SELECT * FROM `" . DB_PREFIX . "geo_zone` ORDER BY `name`");
|
31: |
|
32: | return $query->rows;
|
33: | }
|
34: | }
|
35: | |