Index.php 520 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. namespace app\api\controller;
  3. use app\common\controller\Api;
  4. use think\Db;
  5. /**
  6. * 首页接口
  7. */
  8. class Index extends Api
  9. {
  10. protected $noNeedLogin = ['banner'];
  11. protected $noNeedRight = ['*'];
  12. /**
  13. * 首页
  14. *
  15. */
  16. public function index()
  17. {
  18. $this->success('请求成功');
  19. }
  20. public function banner(){
  21. $list = Db::name('banner')->order('weigh desc')->select();
  22. $list = list_domain_image($list,['image']);
  23. $this->success(1,$list);
  24. }
  25. }