Bootstrap

PHP 电子围栏状态



    /**
     * 围栏状态
     * @desc (围栏状态)
     * @return array
     * @api (int ,data,园区围栏,)
     * @api (int ,lnt,当前经度,)
     * @api (int ,lat,当前车纬度,)
     * @api (int ,type,1,)
     * @returnApi (string,p_status,0:外;1:内,)
     */
    public function mqttStatus($data, $lat, $lnt, $type = 1)
    {
   
        $p_status = 0;
        $distance = new Distance();
        if ($type == 1) {
   
            //判断是否在 园区内
            $p_status = 0;//在园区内的停车范围外 :1;园区外:2;
            $i = 0;
            $mqtt = [];
            foreach ($data['content'][0]['path'] as $value) {
   
                $mqtt[] = [
                    'lng' => $value[0],
                    'lat' => $value[1]
                
;