MessageNoticeLog.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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\Core;
  7. class MessageNoticeLog extends \We7Table {
  8. protected $tableName = 'message_notice_log';
  9. protected $primaryKey = 'id';
  10. protected $field = array(
  11. 'message',
  12. 'is_read',
  13. 'uid',
  14. 'sign',
  15. 'type',
  16. 'status',
  17. 'create_time',
  18. 'end_time',
  19. 'url',
  20. );
  21. protected $default = array(
  22. 'message' => '',
  23. 'is_read' => '1',
  24. 'uid' => '0',
  25. 'sign' => '',
  26. 'type' => '0',
  27. 'status' => '0',
  28. 'create_time' => '0',
  29. 'end_time' => '0',
  30. 'url' => '',
  31. );
  32. public function searchWithUid($uid) {
  33. return $this->query->where('uid', $uid);
  34. }
  35. public function searchWithIsRead($is_read) {
  36. return $this->query->where('is_read', $is_read);
  37. }
  38. public function searchWithType($type) {
  39. return $this->query->where('type', $type);
  40. }
  41. public function searchWithOutType($type) {
  42. return $this->query->where('type !=', $type);
  43. }
  44. public function messageExists($message) {
  45. return $this->query->where($message)->get();
  46. }
  47. }