$SubSection = new Section;
$res = $SubSection->all();
$excelArr = $this->excelArr();
// echo "<pre>";
$C = new Core();
foreach ($res as $key => $v1) {
$v2 = $v1->toArray();
// print_r($v2);
$s = [[
'lat' => (float)$v2["startLat"],
'lng' => (float)$v2["startLng"]
]];
$e = [[
'lat' => (float)$v2["endLat"],
'lng' => (float)$v2["endLng"]
]];
$countArr = [$C->countArr($s, $excelArr),$C->countArr($e, $excelArr)];
$newarr[] = [
$countArr[0]["nearName"],
$countArr[0]["lng"],
$countArr[0]["lat"]
];
$newarr[] = [
$countArr[1]["nearName"],
$countArr[1]["lng"],
$countArr[1]["lat"]
];
$bbb[] = array_slice($newarr, $key * 2, 2);
$v4["start"] = $bbb[$key][1];
$v4["end"] = $bbb[$key][0];
//
$sliceArr[] = [
"color"=>$v2["color"],
"zindex"=>$v2["zindex"],
"weight"=>$v2["weight"],
"data"=>$this->subSectionLength($v4, $excelArr)
];
}