Stat.php 1004 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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\Qrcode;
  7. class Stat extends \We7Table {
  8. protected $tableName = 'qrcode_stat';
  9. protected $primaryKey = 'id';
  10. protected $field = array(
  11. 'uniacid',
  12. 'acid',
  13. 'qid',
  14. 'openid',
  15. 'type',
  16. 'qrcid',
  17. 'scene_str',
  18. 'name',
  19. 'createtime',
  20. );
  21. protected $default = array(
  22. 'uniacid' => '0',
  23. 'acid' => '',
  24. 'qid' => '',
  25. 'openid' => '',
  26. 'type' => '0',
  27. 'qrcid' => '0',
  28. 'scene_str' => '',
  29. 'name' => '',
  30. 'createtime' => '0',
  31. );
  32. public function searchWithTime($start_time, $end_time) {
  33. return $this->query->where('createtime >=', $start_time)->where('createtime <=', $end_time);
  34. }
  35. public function searchWithKeyword($keyword) {
  36. return $this->query->where('name LIKE', "%{$keyword}%");
  37. }
  38. public function searchWithUniacid($uniacid) {
  39. return $this->query->where('uniacid', $uniacid);
  40. }
  41. }