<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/9/20
 * Time: 16:46
 */

namespace app\api\controller;
use app\common\model\Guide as GuideModel;

class Guide extends Base
{
    /**
     * 美行攻略详情
     * @url /api/Guide/detail
     * @param int $id 攻略id
     * @return json
     */
    public function detail($id=0)
    {
        if(empty($id)) return ['code'=>1,'msg'=>'缺少参数ID'];
        $data = GuideModel::order('id','desc')->find($id);
        if(!$data) return ['code'=>1,'msg'=>'攻略不存在'];
        return ['code'=>1,'msg'=>'success','data'=>$data];
    }
}