<?php
namespace app\api\controller;
use app\admin\model\institution\{Ade,Institution as Insti};
use app\common\controller\Api;
use app\common\model\AidStation;
use liuniu\UtilService;
use think\Request;

class Institution extends Api
{
    protected $noNeedLogin = [];
    protected $noNeedRight = ['*'];
    public function ade(Request $request)
    {
        list($latitude, $longitude, $page, $limit,$all) = UtilService::getMore(
            [
                ['latitude',''],
                ['longitude',''],
                ['page',1],
                ['limit',10],
                ['all',0],
            ],$request,true

        );

        if($all==0) $cid = $this->cid; else $cid=0;
        $this->success('获取成功',Ade::lst($cid,$latitude,$longitude,$page,$limit));
    }
    public function insti(Request $request)
    {
        list($latitude, $longitude, $page, $limit) = UtilService::getMore(
            [
                ['latitude',''],
                ['longitude',''],
                ['page',1],
                ['limit',10],
            ],$request,true

        );
        $this->success('获取成功',Insti::lst($this->cid,$latitude,$longitude,$page,$limit));
    }
    public function station(Request $request)
    {
        list($latitude, $longitude, $page, $limit) = UtilService::getMore(
            [
                ['latitude',''],
                ['longitude',''],
                ['page',1],
                ['limit',10],
            ],$request,true

        );
        $this->success('获取成功',AidStation::lst($this->cid,$latitude,$longitude,$page,$limit));
    }
}
