Banner.php 594 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. //轮播图
  13. public function banner()
  14. {
  15. $list = Db::name('banner')->field('id, title, image, url')
  16. ->where('company_id',$this->auth->company_id)
  17. ->where(['status' => 1])
  18. ->order(['weigh' => 'desc', 'id' => 'desc'])
  19. ->select();
  20. $list = list_domain_image($list, ['image']);
  21. $this->success(1, $list);
  22. }
  23. }