VisitIp.php 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. /**
  3. * [WeEngine System] Copyright (c) 2014 WE7.CC
  4. * WeEngine is NOT a free software, it under the license terms, visited http://www.we7.cc/ for more details.
  5. */
  6. namespace We7\Table\Stat;
  7. class VisitIp extends \We7Table {
  8. protected $tableName = 'stat_visit_ip';
  9. protected $primaryKey = 'id';
  10. protected $field = array(
  11. 'ip',
  12. 'uniacid',
  13. 'type',
  14. 'module',
  15. 'date',
  16. );
  17. protected $default = array(
  18. 'ip' => '',
  19. 'uniacid' => '',
  20. 'type' => '',
  21. 'module' => '',
  22. 'date' => '',
  23. );
  24. public function searchWithIp($ip) {
  25. return $this->query->where('ip', $ip);
  26. }
  27. public function searchWithDate($date) {
  28. return $this->query->where('date', $date);
  29. }
  30. public function searchWithGreaterThenDate($date) {
  31. return $this->query->where('date >=', $date);
  32. }
  33. public function searchWithLessThenDate($date) {
  34. return $this->query->where('date <=', $date);
  35. }
  36. public function searchWithModule($module) {
  37. return $this->query->where('module', $module);
  38. }
  39. public function searchWithType($type) {
  40. return $this->query->where('type', $type);
  41. }
  42. }