作者 王智

daima

@@ -326,15 +326,16 @@ class Index extends Api @@ -326,15 +326,16 @@ class Index extends Api
326 if (empty($param['lng']) || $param['lng'] == null || $param['lng'] == '' || $param['lng'] == "") { 326 if (empty($param['lng']) || $param['lng'] == null || $param['lng'] == '' || $param['lng'] == "") {
327 $ruestul[$k]['from'] = '暂无距离信息'; 327 $ruestul[$k]['from'] = '暂无距离信息';
328 } else { 328 } else {
329 - $ruestul[$k]['from'] = $this->getDistance($param['lng'], $param['lat'], $v['lng'], $v['lat']) . 'km'; 329 + $ruestul[$k]['from'] = $this->getDistance($param['lng'], $param['lat'], $v['lng'], $v['lat']);
330 } 330 }
331 $ruestul[$k]['talk_num'] = $v['talk_num']; 331 $ruestul[$k]['talk_num'] = $v['talk_num'];
332 } 332 }
333 $newarr = array_column($ruestul, 'from'); 333 $newarr = array_column($ruestul, 'from');
334 array_multisort($newarr, SORT_ASC, $ruestul); 334 array_multisort($newarr, SORT_ASC, $ruestul);
335 - dump($ruestul);  
336 - die;  
337 $ruestul = $this->page_array($param['rows'], $param['pages'], $ruestul, 0); 335 $ruestul = $this->page_array($param['rows'], $param['pages'], $ruestul, 0);
  336 + foreach ($ruestul as $k => $v) {
  337 + $ruestul[$k]['from'] = $v['from'] . 'km';
  338 + }
338 $list = [ 339 $list = [
339 'count' => count($count), 340 'count' => count($count),
340 'list' => $ruestul 341 'list' => $ruestul