News.php 553 B

1234567891011121314151617181920212223242526
  1. <?php
  2. namespace app\api\controller;
  3. use app\common\controller\Api;
  4. use think\Db;
  5. /**
  6. * 新闻
  7. */
  8. class News extends Api
  9. {
  10. protected $noNeedLogin = ['*'];
  11. protected $noNeedRight = ['*'];
  12. public function find(){
  13. $key = input('key');
  14. if(!$key){
  15. $this->error();
  16. }
  17. $fields = 'name,video_file,content,updatetime';
  18. $find = Db::name('news')->field($fields)->where('key',$key)->find();
  19. $find = info_domain_image($find,['video_file']);
  20. $this->success('success',$find);
  21. }
  22. }