News.php 389 B

12345678910111213141516171819
  1. <?php
  2. namespace Demo\Database\Model;
  3. use Dever;
  4. /**
  5. * 文章model兼容类,直接替换database/news里的request方法,必须是静态方法
  6. */
  7. class News
  8. {
  9. private static $name = 'news_list';
  10. public static function all($param)
  11. {
  12. $data = Dever::db('old')->fetchAll('select * from ' . self::$name . ' limit 10');
  13. echo Dever::sql();
  14. print_r($data);die;
  15. return $data;
  16. }
  17. }