<?php namespace app\api\controller; use app\common\controller\Api; use think\Db; /** * 示例接口 */ class Banner extends Api { protected $noNeedLogin = ['*']; protected $noNeedRight = ['*']; //轮播图 public function banner() { $where = [ 'status' => 1 ]; $type = input('type',0); if($type){ $where['type'] = $type; } $list = Db::name('banner')->field('id, title, image')->where($where)->order('weigh', 'desc')->select(); $list = list_domain_image($list, ['image']); $this->success(1, $list); } }