Keyword.php 962 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\Rule;
  7. class Keyword extends \We7Table {
  8. protected $tableName = 'rule_keyword';
  9. protected $primaryKey = 'id';
  10. protected $field = array(
  11. 'rid',
  12. 'uniacid',
  13. 'module',
  14. 'content',
  15. 'type',
  16. 'displayorder',
  17. 'status',
  18. );
  19. protected $default = array(
  20. 'rid' => '0',
  21. 'uniacid' => '0',
  22. 'module' => '',
  23. 'content' => '',
  24. 'type' => '1',
  25. 'displayorder' => '1',
  26. 'status' => '1',
  27. );
  28. public function getByUniacidAndContent($uniacid, $content, $status = 1) {
  29. return $this->where(array(
  30. 'uniacid' => $uniacid,
  31. 'content' => $content,
  32. 'status' => $status,
  33. ))->get();
  34. }
  35. public function searchWithCoverReply() {
  36. return $this->query->from($this->tableName, 'a')
  37. ->leftjoin('cover_reply', 'b')
  38. ->on(array(
  39. 'a.rid' => 'b.rid'
  40. ));
  41. }
  42. }