人人商城

StatVisit.php 967B

1234567891011121314151617181920212223242526272829303132333435363738394041
  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\System;
  7. class StatVisit extends \We7Table {
  8. protected $tableName = 'system_stat_visit';
  9. protected $primaryKey = 'id';
  10. protected $field = array(
  11. 'uniacid',
  12. 'modulename',
  13. 'uid',
  14. 'displayorder',
  15. 'createtime',
  16. 'updatetime',
  17. );
  18. protected $default = array(
  19. 'uniacid' => '',
  20. 'modulename' => '',
  21. 'uid' => '',
  22. 'displayorder' => 0,
  23. 'createtime' => '',
  24. 'updatetime' => '',
  25. );
  26. public function deleteVisitRecord($uid, $delete_modules = array()) {
  27. if (!empty($delete_modules)) {
  28. $this->query->where('modulename', $delete_modules);
  29. }
  30. return $this->query->where('uid', $uid)
  31. ->where('uniacid', 0)
  32. ->delete();
  33. }
  34. public function getVistedModule($uid) {
  35. return $this->query->where('uid', $uid)->where('uniacid', 0)->getall('modulename');
  36. }
  37. }