Back to Opencart

File catalog\model\marketing\marketing.php

docs/api/source-catalog.model.marketing.marketing.html

4.1.0.33.6 KB
Original Source

Namespaces

Classes

| 1: | <?php | | 2: | namespace Opencart\Catalog\Model\Marketing; | | 3: | /** | | 4: | * Class Marketing | | 5: | * | | 6: | * @package Opencart\Catalog\Model\Marketing | | 7: | */ | | 8: | class Marketing extends \Opencart\System\Engine\Model { | | 9: | /** | | 10: | * Get Marketing By Code | | 11: | * | | 12: | * @param string $code | | 13: | * | | 14: | * @return array<string, mixed> | | 15: | */ | | 16: | public function getMarketingByCode(string $code): array { | | 17: | $query = $this->db->query("SELECT DISTINCT * FROM " . DB\_PREFIX . "marketing WHERE code = '" . $this->db->escape($code) . "'"); | | 18: | | | 19: | return $query->row; | | 20: | } | | 21: | | | 22: | /** | | 23: | * Add Report | | 24: | * | | 25: | * @param int $marketing_id | | 26: | * @param string $ip | | 27: | * @param string $country | | 28: | * | | 29: | * @return void | | 30: | */ | | 31: | public function addReport(int $marketing_id, string $ip, string $country = ''): void { | | 32: | $this->db->query("INSERT INTO " . DB\_PREFIX . "marketing\_report SET marketing\_id = '" . (int)$marketing_id . "', store_id = '" . (int)$this->config->get('config_store_id') . "', ip = '" . $this->db->escape($ip) . "', country = '" . $this->db->escape($country) . "', date_added = NOW()"); | | 33: | } | | 34: | } | | 35: | |

OpenCart API API documentation generated by ApiGen dev-master