articlenews.table.php 667 B

1234567891011121314151617181920212223
  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 ArticlenewsTable extends We7Table {
  8. protected $tableName = 'article_news';
  9. public function getArticleNewsLists($order) {
  10. return $this->query->from($this->tableName)->orderby($order, 'DESC')->getall();
  11. }
  12. public function searchWithCreatetimeRange($time) {
  13. return $this->query->where('createtime >=', strtotime("-{$time} days"));
  14. }
  15. public function searchWithTitle($title) {
  16. return $this->query->where('title LIKE', "%{$title}%");
  17. }
  18. }