<?php namespace Place\Api;
use Dever;
use Place;
class Tool
{
    # 根据身份码获取入口
    public function code()
    {
        $code = Dever::input('code');
        if (!$code) {
            Dever::error('请输入身份码');
        }
        $code = Dever::db('code', 'place')->find(array('code' => $code));
        if (!$code) {
            Dever::error('身份码错误');
        }
        return array('p' => Place::entry($code['sector_id'], $code['module_id'], $code['user_id'], $code['place_id']));
    }
}