Banner.php 569 B

123456789101112131415161718192021222324252627
  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. public function __construct(){
  13. $this->error('投票活动结束了');
  14. }
  15. //轮播图
  16. public function banner()
  17. {
  18. $list = Db::name('banner')->field('id, title, image, url')->where(['status' => 1])->order('weigh', 'desc')->select();
  19. $list = list_domain_image($list, ['image']);
  20. $this->success(1, $list);
  21. }
  22. }