uawdijnntqw1x1x1
IP : 3.145.184.248
Hostname : ns1.eurodns.top
Kernel : Linux ns1.eurodns.top 4.18.0-553.5.1.lve.1.el7h.x86_64 #1 SMP Fri Jun 14 14:24:52 UTC 2024 x86_64
Disable Function : mail,sendmail,exec,passthru,shell_exec,system,popen,curl_multi_exec,show_source,eval,open_base
OS : Linux
PATH:
/
home
/
sudancam
/
.trash
/
quran
/
..
/
admin
/
model
/
extension
/
report
/
customer_transaction.php
/
/
<?php class ModelExtensionReportCustomerTransaction extends Model { public function getTransactions($data = array()) { $sql = "SELECT ct.customer_id, CONCAT(c.firstname, ' ', c.lastname) AS customer, c.email, cgd.name AS customer_group, c.status, SUM(ct.amount) AS total FROM `" . DB_PREFIX . "customer_transaction` ct LEFT JOIN `" . DB_PREFIX . "customer` c ON (ct.customer_id = c.customer_id) LEFT JOIN `" . DB_PREFIX . "customer_group_description` cgd ON (c.customer_group_id = cgd.customer_group_id) WHERE cgd.language_id = '" . (int)$this->config->get('config_language_id') . "'"; if (!empty($data['filter_date_start'])) { $sql .= " AND DATE(ct.date_added) >= '" . $this->db->escape($data['filter_date_start']) . "'"; } if (!empty($data['filter_date_end'])) { $sql .= " AND DATE(ct.date_added) <= '" . $this->db->escape($data['filter_date_end']) . "'"; } if (!empty($data['filter_customer'])) { $sql .= " AND CONCAT(c.firstname, ' ', c.lastname) LIKE '" . $this->db->escape($data['filter_customer']) . "'"; } $sql .= " GROUP BY ct.customer_id ORDER BY total DESC"; if (isset($data['start']) || isset($data['limit'])) { if ($data['start'] < 0) { $data['start'] = 0; } if ($data['limit'] < 1) { $data['limit'] = 20; } $sql .= " LIMIT " . (int)$data['start'] . "," . (int)$data['limit']; } $query = $this->db->query($sql); return $query->rows; } public function getTotalTransactions($data = array()) { $sql = "SELECT COUNT(DISTINCT ct.customer_id) AS total FROM `" . DB_PREFIX . "customer_transaction` ct LEFT JOIN `" . DB_PREFIX . "customer` c ON (ct.customer_id = c.customer_id)"; $implode = array(); if (!empty($data['filter_date_start'])) { $implode[] = "DATE(ct.date_added) >= '" . $this->db->escape($data['filter_date_start']) . "'"; } if (!empty($data['filter_date_end'])) { $implode[] = "DATE(ct.date_added) <= '" . $this->db->escape($data['filter_date_end']) . "'"; } if (!empty($data['filter_customer'])) { $implode[] = "CONCAT(c.firstname, ' ', c.lastname) LIKE '" . $this->db->escape($data['filter_customer']) . "'"; } if ($implode) { $sql .= " WHERE " . implode(" AND ", $implode); } $query = $this->db->query($sql); return $query->row['total']; } }
/home/sudancam/.trash/quran/../admin/model/extension/report/customer_transaction.php