<?php

namespace app\api\controller;

use app\common\controller\Api;
use think\Db;
/**
 * 示例接口
 */
class Banner extends Api
{
    protected $noNeedLogin = ['*'];
    protected $noNeedRight = ['*'];

    //轮播图
    public function banner()
    {
        $type = input('type',1);

        $where = [
            'status' => 1,
            'type'   => $type,
        ];
        $list = Db::name('banner')->field('id, title, image, url')->where($where)->order('weigh', 'desc')->select();
        $list = list_domain_image($list, ['image']);

        $this->success(1, $list);
    }
}
