Banner.php 593 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. namespace app\api\controller;
  3. use app\common\controller\Api;
  4. use think\Db;
  5. /**
  6. * 示例接口
  7. */
  8. class Banner extends Api
  9. {
  10. protected $noNeedLogin = ['*'];
  11. protected $noNeedRight = ['*'];
  12. //轮播图
  13. public function banner()
  14. {
  15. $type = input('type',1);
  16. $where = [
  17. 'status' => 1,
  18. 'type' => $type,
  19. ];
  20. $list = Db::name('banner')->field('id, title, image, url')->where($where)->order('weigh', 'desc')->select();
  21. $list = list_domain_image($list, ['image']);
  22. $this->success(1, $list);
  23. }
  24. }