作者 开飞机的舒克
1 个管道 的构建 通过 耗费 1 秒

上传代码

... ... @@ -39,7 +39,7 @@ class Index extends Api
public function getDistance(){
$lon = (float)$this->request->param('lng');
$lat = (float)$this->request->param('lat');
$data = db('store')->field('id,name,lng,lat')->select();
$data = db('store')->where(['status'=>1])->field('id,name,lng,lat')->select();
foreach ($data as $k => $v){
$data[$k]['dist'] = Resource::getdistance($v['lng'],$v['lat'],$lon,$lat,2,2);
}
... ... @@ -104,6 +104,7 @@ class Index extends Api
$data['num'] = db('people')->field('id,num')->select();
//获取技师名单
$tech = new Tech();
$data['tech'] = $tech->select();
//获取时长
$data['duration'] = db('duration')->field('id,time')->select();
... ...