Banner.php 970 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. namespace app\api\controller\company;
  3. use app\common\controller\Apic;
  4. use think\Db;
  5. /**
  6. * 轮播图管理
  7. */
  8. class Banner extends Apic
  9. {
  10. protected $noNeedLogin = [];
  11. protected $noNeedRight = '*';
  12. //某门店的轮播图
  13. public function banner_list(){
  14. $where = [
  15. 'company_id' => $this->auth->company_id,
  16. 'position' => 0, //首页
  17. ];
  18. $index = Db::name('banner')->where($where)->order('weigh desc,id desc')->select();
  19. $index = list_domain_image($index,['image']);
  20. $where = [
  21. 'company_id' => $this->auth->company_id,
  22. 'position' => 1, //门店印象
  23. ];
  24. $store = Db::name('banner')->where($where)->order('weigh desc,id desc')->autopage()->select();
  25. $store = list_domain_image($store,['image']);
  26. $rs = [
  27. 'index' => $index,
  28. 'store' => $store,
  29. ];
  30. $this->success(1,$rs);
  31. }
  32. }