Category.php 788 B

1234567891011121314151617181920212223242526272829
  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\Article;
  7. class Category extends \We7Table {
  8. protected $tableName = 'article_category';
  9. protected $primaryKey = 'id';
  10. protected $field = array(
  11. 'title',
  12. 'displayorder',
  13. 'type',
  14. );
  15. protected $default = array(
  16. 'title' => '',
  17. 'displayorder' => 0,
  18. 'type' => '',
  19. );
  20. public function getNewsCategoryLists() {
  21. return $this->where('type', 'news')->orderby(array('displayorder' => 'DESC', 'id' => 'DESC'))->getall('id');
  22. }
  23. public function getNoticeCategoryLists() {
  24. return $this->where('type', 'notice')->orderby(array('displayorder' => 'DESC', 'id' => 'DESC'))->getall('id');
  25. }
  26. }