<?php

namespace app\api\controller;

use app\common\controller\Api;
use \app\common\model\Features as FeaturesModel;

/**
 * 专题接口
 */
class Features extends Api
{
    protected $noNeedRight = ['*'];
    protected $noNeedLogin = ['*'];
    /**
     * 背景图
     */
    public function carousel(){
        $this->success('请求成功',config('site.features'));
    }

    /**
     * 专题列表
     * @param string $page 页数
     */
    public function featureslist(){
        $data = $this->_validate(['page|页数'=>'require']);
        $this->success('请求成功',FeaturesModel::where('status',1)->page($data['page'],10)->select());
    }

    /**
     *  专题详情
     * @param string $id 专题id
     */
    public function featuresdetails(){
        $where = [
            'status'=>1,
            'id'=>input('id')
        ];
        $this->success('请求成功',FeaturesModel::where($where)->findOrFail());
    }

    /**
     *
     */

}