芝麻web文件管理V1.00
编辑当前文件:/home/qrafawbu/lugarcollectibles.com/admin/model/report/online.php
db->escape($data['filter_ip']) . "'"; } if (!empty($data['filter_customer'])) { $implode[] = "co.customer_id > 0 AND CONCAT(c.firstname, ' ', c.lastname) LIKE '" . $this->db->escape($data['filter_customer']) . "'"; } if ($implode) { $sql .= " WHERE " . implode(" AND ", $implode); } $sql .= " ORDER BY co.date_added 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 getTotalOnline($data = array()) { $sql = "SELECT COUNT(*) AS total FROM `" . DB_PREFIX . "customer_online` co LEFT JOIN " . DB_PREFIX . "customer c ON (co.customer_id = c.customer_id)"; $implode = array(); if (!empty($data['filter_ip'])) { $implode[] = "co.ip LIKE '" . $this->db->escape($data['filter_ip']) . "'"; } if (!empty($data['filter_customer'])) { $implode[] = "co.customer_id > 0 AND 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']; } }