Topichub.php 964 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. namespace app\api\controller;
  3. use app\common\controller\Api;
  4. use think\Db;
  5. /**
  6. * 话题中心
  7. */
  8. class Topichub extends Api
  9. {
  10. protected $noNeedLogin = ['*'];
  11. protected $noNeedRight = ['*'];
  12. //全部话题
  13. public function lists(){
  14. $list = Db::name('topic_hub')->where('status',1)->order('weight desc,id desc')->autopage()->select();
  15. $list = list_domain_image($list,['image']);
  16. $this->success('success',$list);
  17. }
  18. //某个话题详情
  19. public function info(){
  20. $id = input('id',0);
  21. $info = Db::name('topic_hub')->where(['status'=>1,'id'=>$id])->find();
  22. $info = info_domain_image($info,['image']);
  23. $this->success('success',$info);
  24. }
  25. //轮播图
  26. public function banner(){
  27. $list = Db::name('topic_banner')->where('status',1)->order('weight desc')->select();
  28. $list = list_domain_image($list,['image']);
  29. $this->success(1,$list);
  30. }
  31. }