<?php
namespace Api\Controller;

use Think\Controller;

header("Content-Type:text/html;CharSet=UTF-8");
class ExhibitionController extends BaseController
{
	/**
	 * 展示图列表
	 */
	public function index()
    {   
       
        $list = M('exhibition')->where(array('business_id' => $this->data['business_id'], 'status' => 1))->order('addtime desc')->select();
       
        
        if (empty($list)) apiReturn(['status' => -1, 'msg' => '没有数据']);
    
        foreach ($list as $k => &$v) {
        	$v['img'] = $this->url.'/Uploads/'.$v['img'];
        }

        apiReturn(['status' => 1, 'msg' => '已获取数据', 'data' => $list]);
    }

    /**
     * 轮播图详情
     */
    /*public function detail()
    {
    	if (empty($this->data['id'])) apiReturn(['status' => -1, '轮播图id不能为空']);

    	$detail = M('chart')->where(array('id' => $this->data['id']))->field('img, title, des')->find();

    	if (empty($detail)) apiReturn(['status' => -1, 'msg' => '没有数据']);

    	$detail['img'] = $this->url.'/Uploads/'.$detail['img'];
    	apiReturn(['status' => 1, 'msg' => '已获取数据', 'data' => $detail]);
    }*/

}