article.table.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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. defined('IN_IA') or exit('Access Denied');
  7. class ArticleTable extends We7Table {
  8. protected $article_noticle_table ='article_notice';
  9. protected $article_news_table = 'article_news';
  10. protected $article_category_table = 'article_category';
  11. protected $article_unread_notice_table = 'article_unread_notice';
  12. public function articleList($params, $type = 'more') {
  13. global $_W;
  14. $this->query->from($this->article_noticle_table);
  15. if (!empty($params['uniacid'])) {
  16. $this->query->where('uniacid', $params['uniacid']);
  17. }
  18. if (!empty($params['is_display'])) {
  19. $this->query->where('is_display', $params['is_display']);
  20. }
  21. if (!empty($params['order'])) {
  22. $this->query->orderby($params['order']);
  23. }
  24. if (!empty($params['limit'])) {
  25. $this->query->limit($params['limit'][0], $params['limit'][1]);
  26. }
  27. if (!empty($params['fields'])) {
  28. $this->query->select($params['fields']);
  29. }
  30. if ($type == 'one') {
  31. return $this->query->get();
  32. } else {
  33. return $this->query->getall();
  34. }
  35. }
  36. }